summary refs log tree commit diff
path: root/xevents.c
diff options
context:
space:
mode:
authorokan <okan>2014-01-28 13:40:40 +0000
committerokan <okan>2014-01-28 13:40:40 +0000
commitdf15337a9f180e41d5489ad9d45fc39ed3cdd335 (patch)
tree19aba9932ffc332a819ebafb468819f0ed03d825 /xevents.c
parent51b3fbee52a54cd068b5485542b454244d651c34 (diff)
downloadcwm-df15337a9f180e41d5489ad9d45fc39ed3cdd335.tar.gz
cwm-df15337a9f180e41d5489ad9d45fc39ed3cdd335.tar.xz
cwm-df15337a9f180e41d5489ad9d45fc39ed3cdd335.zip
The EWMH spec states that if the cardinal returned is 0xFFFFFFFF (-1)
then the window should appear on all desktops, which in our case is
assigned to group 0.  Found to fix stalonetray due to the non-ewmh aware
range checking in group_movetogroup(); from Thomas Adam.
Diffstat (limited to 'xevents.c')
-rw-r--r--xevents.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/xevents.c b/xevents.c
index b01f966..b321acb 100644
--- a/xevents.c
+++ b/xevents.c
@@ -346,8 +346,17 @@ xev_handle_clientmessage(XEvent *ee)
 		client_ptrwarp(cc);
 	}
 
-	if (e->message_type == ewmh[_NET_WM_DESKTOP] && e->format == 32)
-		group_movetogroup(cc, e->data.l[0]);
+	if (e->message_type == ewmh[_NET_WM_DESKTOP] && e->format == 32) {
+		/*
+		 * The EWMH spec states that if the cardinal returned is
+		 * 0xFFFFFFFF (-1) then the window should appear on all
+		 * desktops, which in our case is assigned to group 0.
+		 */
+		if (e->data.l[0] == (unsigned long)-1)
+			group_movetogroup(cc, 0);
+		else
+			group_movetogroup(cc, e->data.l[0]);
+	}
 
 	if (e->message_type == ewmh[_NET_WM_STATE] && e->format == 32)
 		xu_ewmh_handle_net_wm_state_msg(cc,