1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Add config option to supress focus requests across workspaces

In commit d6c134f420 ("Do not switch
workspace to follow new windows in others") the default behavior
was changed, and workspace switching to follow focus requests was
strictly forbidden.

Although that seems to be a sane thing to do by default, that raises
concerns about whether Window Maker could be more flexible in that
respect -- allowing the user to choose which applications are or
are not allowed to do that.

This patch adds such configuration, located in the "Advanced Options"
submenu of the top-level "Attributes" menu.
This commit is contained in:
Carlos R. Mafra
2009-08-25 21:15:35 +02:00
parent ca60620f50
commit 6d75291e1d
5 changed files with 50 additions and 20 deletions

View File

@@ -1448,15 +1448,19 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent * event)
if (!wwin)
return False;
/*
* 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);
if (event->message_type == net_active_window) {
/*
* Firefox sends aditional 'net_active_window' signals on startup if
* multiple tabs are open. That causes unnecessary workspace switching if
* those signals come from other workspaces. Therefore we also check if
* we should ignore these spurious focus across workspaces requests (but
* allow the switching if it comes from a pager).
*/
if (wwin->frame->workspace == wwin->screen_ptr->current_workspace
|| !WFLAGP(wwin, dont_focus_across_wksp) || event->data.l[0] == 2) {
wNETWMShowingDesktop(scr, False);
wMakeWindowVisible(wwin);
}
} else if (event->message_type == net_close_window) {
if (!WFLAGP(wwin, no_closable)) {
if (wwin->protocols.DELETE_WINDOW)