Correctly count the number of windows for no_focus. (#2296)

Previously we counted the number of (direct) children of the workspace to
decide whether no_focus should be applied or not. However, this doesn't
work correctly if there's a single container with multiple windows on the
workspace.

This patch correctly counts all windows on the workspace.

fixes #2292
This commit is contained in:
Ingo Bürk
2016-04-15 09:26:42 +02:00
committed by Michael Stapelberg
parent 83c8740bf1
commit 80dddd9961
3 changed files with 27 additions and 1 deletions

View File

@ -577,7 +577,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
/* The first window on a workspace should always be focused. We have to
* compare with == 1 because the container has already been inserted at
* this point. */
if (con_num_children(ws) == 1) {
if (con_num_windows(ws) == 1) {
DLOG("This is the first window on this workspace, ignoring no_focus.\n");
} else {
DLOG("no_focus was set for con = %p, not setting focus.\n", nc);