event.c
changeset 229 f4f5d000ce7a
parent 217 7b63c375d28c
child 230 b92bbc2487c9
--- a/event.c	Tue Aug 08 12:58:05 2006 +0200
+++ b/event.c	Tue Aug 08 17:08:45 2006 +0200
@@ -146,6 +146,18 @@
 }
 
 static void
+clientmessage(XEvent *e)
+{
+	Client *c;
+	XClientMessageEvent *ev = &e->xclient;
+
+	if(ev->message_type == netatom[NetActiveWindow]) {
+		if((c = getclient(ev->window)) && c->tags[tsel])
+			focus(c);
+	}
+}
+
+static void
 configurerequest(XEvent *e)
 {
 	Client *c;
@@ -339,6 +351,7 @@
 
 void (*handler[LASTEvent]) (XEvent *) = {
 	[ButtonPress] = buttonpress,
+	[ClientMessage] = clientmessage,
 	[ConfigureRequest] = configurerequest,
 	[DestroyNotify] = destroynotify,
 	[EnterNotify] = enternotify,