summary refs log tree commit diff
path: root/xevents.c
diff options
context:
space:
mode:
authorokan <okan>2014-01-03 14:23:50 +0000
committerokan <okan>2014-01-03 14:23:50 +0000
commitf4c289b9e63c3daec2b6523871e07328dc778bb6 (patch)
tree5f7a62e413a7e25a9662bf2e23c3b0bb151b3cbb /xevents.c
parentb387351df1593020665df5e5ee5d86d16ad8b7d6 (diff)
parent08342471c86ca88dbfe71fffa55697f92378ff76 (diff)
downloadcwm-f4c289b9e63c3daec2b6523871e07328dc778bb6.tar.gz
cwm-f4c289b9e63c3daec2b6523871e07328dc778bb6.tar.xz
cwm-f4c289b9e63c3daec2b6523871e07328dc778bb6.zip
cvsimport
Diffstat (limited to 'xevents.c')
-rw-r--r--xevents.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/xevents.c b/xevents.c
index b1d4c64..f638fac 100644
--- a/xevents.c
+++ b/xevents.c
@@ -246,7 +246,7 @@ xev_handle_buttonpress(XEvent *ee)
 		cc->sc = screen_fromroot(e->window);
 	}
 
-	(*mb->callback)(cc, e);
+	(*mb->callback)(cc, &mb->argument);
 }
 
 static void
@@ -326,8 +326,11 @@ xev_handle_clientmessage(XEvent *ee)
 {
 	XClientMessageEvent	*e = &ee->xclient;
 	struct client_ctx	*cc, *old_cc;
+	struct screen_ctx       *sc;
 
-	if ((cc = client_find(e->window)) == NULL)
+	sc = screen_fromroot(e->window);
+
+	if ((cc = client_find(e->window)) == NULL && e->window != sc->rootwin)
 		return;
 
 	if (e->message_type == cwmh[WM_CHANGE_STATE] && e->format == 32 &&
@@ -342,9 +345,16 @@ xev_handle_clientmessage(XEvent *ee)
 			client_ptrsave(old_cc);
 		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_STATE] && e->format == 32)
 		xu_ewmh_handle_net_wm_state_msg(cc,
 		    e->data.l[0], e->data.l[1], e->data.l[2]);
+
+	if (e->message_type == ewmh[_NET_CURRENT_DESKTOP] && e->format == 32)
+		group_only(sc, e->data.l[0]);
 }
 
 static void