[PATCH] only allow to switch to new window when requested by a tool

From: Andreas Amann <andreas.amann_AT_web.de>
Date: Sun, 10 Mar 2013 00:40:15 +0000

according to http://standards.freedesktop.org/wm-spec the
_NET_ACTIVE_WINDOW message contains in data.l[0] a source indication,
which should be 1 when the request comes from an application, and 2
when it comes from a pager. We only honour focus change requests, if
they come from a pager.
---
 dwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dwm.c b/dwm.c
index bd25d10..2c20478 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -542,7 +542,7 @@ clientmessage(XEvent *e) {
 			setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD    */
 			              || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
 	}
-	else if(cme->message_type == netatom[NetActiveWindow]) {
+	else if(cme->message_type == netatom[NetActiveWindow] && cme->data.l[0] == 2) {
 		if(!ISVISIBLE(c)) {
 			c->mon->seltags ^= 1;
 			c->mon->tagset[c->mon->seltags] = c->tags;
-- 
1.8.1.2
--envbJBWh7q8WU6mo--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 10 2013 - 03:36:02 CET