Bugfix: Don’t change focus when assigned windows start on invisible workspaces (+test) (Thanks ioflag)

Fixes #468
This commit is contained in:
Michael Stapelberg
2011-08-17 16:36:19 +02:00
parent f3cfd3fce3
commit f172359ba5
2 changed files with 80 additions and 3 deletions

View File

@ -264,9 +264,13 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
if (fs == NULL) {
DLOG("Not in fullscreen mode, focusing\n");
if (!cwindow->dock)
con_focus(nc);
else DLOG("dock, not focusing\n");
if (!cwindow->dock) {
/* Check that the workspace is visible. If the window was assigned
* to an invisible workspace, we should not steal focus. */
if (workspace_is_visible(ws)) {
con_focus(nc);
} else DLOG("workspace not visible, not focusing\n");
} else DLOG("dock, not focusing\n");
} else {
DLOG("fs = %p, ws = %p, not focusing\n", fs, ws);
/* Insert the new container in focus stack *after* the currently