all repos — dwm @ 92e55c7c53cb808b584982ac8f6d69112d713fab

my dwm build

implemented NET_ACTIVE_WINDOW support
Anselm R.Garbe arg@10ksloc.org
Tue, 08 Aug 2006 17:08:45 +0200
commit

92e55c7c53cb808b584982ac8f6d69112d713fab

parent

c86f131681182258208ef97e81206ccc44e718ee

4 files changed, 20 insertions(+), 1 deletions(-)

jump to
M client.cclient.c

@@ -58,6 +58,8 @@ drawtitle(old);

drawtitle(c); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); XSync(dpy, False); + XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32, + PropModeReplace, (unsigned char *)&c->win, 1); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); }

@@ -459,6 +461,9 @@ XUngrabServer(dpy);

arrange(NULL); if(sel) focus(sel); + else + XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32, + PropModeReplace, (unsigned char *)NULL, 1); } void
M dwm.hdwm.h

@@ -22,7 +22,7 @@ int i;

}; /* atoms */ -enum { NetSupported, NetWMName, NetLast }; +enum { NetSupported, NetWMName, NetActiveWindow, NetLast }; enum { WMProtocols, WMDelete, WMLast }; /* cursor */
M event.cevent.c

@@ -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 @@ /* extern */

void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, + [ClientMessage] = clientmessage, [ConfigureRequest] = configurerequest, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify,
M main.cmain.c

@@ -201,6 +201,7 @@ wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);

wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); + netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast);