about summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2013-05-20 21:19:15 +0000
committerokan <okan>2013-05-20 21:19:15 +0000
commitad8020e17dc6277cc956d00eb869fc8703079f5f (patch)
tree9f6eb1a78bc7c91c44621adeb18311eb0c407b90
parent284af4ca0c40d7a90ea0f574924abb707db7db05 (diff)
downloadcwm-ad8020e17dc6277cc956d00eb869fc8703079f5f.tar.gz
cwm-ad8020e17dc6277cc956d00eb869fc8703079f5f.tar.xz
cwm-ad8020e17dc6277cc956d00eb869fc8703079f5f.zip
handle _NET_ACTIVE_WINDOW ClientMessage; from Alexander Polakov.
-rw-r--r--xevents.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xevents.c b/xevents.c
index 91da64a..32b2262 100644
--- a/xevents.c
+++ b/xevents.c
@@ -340,7 +340,7 @@ static void
 xev_handle_clientmessage(XEvent *ee)
 {
 	XClientMessageEvent	*e = &ee->xclient;
-	struct client_ctx	*cc;
+	struct client_ctx	*cc, *old_cc;
 
 	if ((cc = client_find(e->window)) == NULL)
 		return;
@@ -351,6 +351,14 @@ xev_handle_clientmessage(XEvent *ee)
 
 	if (e->message_type == ewmh[_NET_CLOSE_WINDOW].atom)
 		client_send_delete(cc);
+
+	if (e->message_type == ewmh[_NET_ACTIVE_WINDOW].atom &&
+	    e->format == 32) {                                                
+		old_cc = client_current();
+		if (old_cc)
+			client_ptrsave(old_cc);
+		client_ptrwarp(cc);
+	}                              
 }
 
 static void