From d6c134f420bfa1cd6b6a9474d01548933b559901 Mon Sep 17 00:00:00 2001 From: Martin Dietze Date: Mon, 24 Aug 2009 21:40:47 +0200 Subject: [PATCH] Do not switch workspace to follow new windows in others New windows should only be focused if they are in the current workspace. Not performing this check can lead to WM switching workspaces if a window is opened which: (a) is configured to appear in a particular workspace and (b) sends a _NET_ACTIVE_WINDOW message to give focus to something, e.g. a sub window. This behaviour was observed with firefox if a session with more than one tab open was restored at startup because: "If a Client wants to activate another window, it MUST send a _NET_ACTIVE_WINDOW client message to the root window:" Original-post: http://lists.windowmaker.info/dev/msg00442.html [crmafra: Added comment] --- src/wmspec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wmspec.c b/src/wmspec.c index 87c0a191..b24cde20 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -1446,7 +1446,13 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent * event) if (!wwin) return False; - if (event->message_type == net_active_window) { + /* + * Firefox with multiple tabs sends aditional 'net_active_window' + * signals on startup, which causes unnecessary workspace switching + * if its initial workspace is different from the current + */ + if (event->message_type == net_active_window && + wwin->frame->workspace == wwin->screen_ptr->current_workspace) { wNETWMShowingDesktop(scr, False); wMakeWindowVisible(wwin); } else if (event->message_type == net_close_window) { -- 2.11.4.GIT