X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/c86f131681182258208ef97e81206ccc44e718ee..92e55c7c53cb808b584982ac8f6d69112d713fab:/event.c diff --git a/event.c b/event.c index 2e4f62e..c3169aa 100644 --- a/event.c +++ b/event.c @@ -145,6 +145,18 @@ buttonpress(XEvent *e) } } +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) { @@ -339,6 +351,7 @@ unmapnotify(XEvent *e) void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, + [ClientMessage] = clientmessage, [ConfigureRequest] = configurerequest, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify,