[hackers] [dwm] [PATCH] don't purge tagset of alternative view on _NET_ACTIVE_WINDOW event

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Thu, 27 Oct 2016 13:13:46 +0200

Before this patch when receiving a _NET_ACTIVE_WINDOW event from a window which
is out of view one of the two altenative views/tagsets gets purged and replaced
with just the tags where the respective window is visible. For example if you
have tags [1,2,3] selected in the first view and tags [4,5,6] on the second view
and are currently on the second one, then when a window on tag 7 sends the
_NET_ACTIVE_WINDOW event the first view is purged and replaced by just tags [7].
To get back to your previous setup you have to re-select tags 1-3 and then have
the views [1,2,3,7] and [4,5,6] where the new window is still on the view you
were not using previously, but on the other one.

After this patch the tags of the event sending window get just added to the
current view directly leading to views [1,2,3] and [4,5,6,7] without any further
user interaction.
---
 dwm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c
index 85ec75e..ab448a3 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -534,8 +534,7 @@ clientmessage(XEvent *e)
 			              || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
 	} else if (cme->message_type == netatom[NetActiveWindow]) {
 		if (!ISVISIBLE(c)) {
-			c->mon->seltags ^= 1;
-			c->mon->tagset[c->mon->seltags] = c->tags;
+			c->mon->tagset[c->mon->seltags] |= c->tags;
 		}
 		pop(c);
 	}
-- 
2.7.3
Received on Thu Oct 27 2016 - 13:13:46 CEST

This archive was generated by hypermail 2.3.0 : Thu Oct 27 2016 - 13:24:15 CEST