-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi,
a friend made me write the attached patch. It adds support for EWMH's _NET_WM_DEMANDS_ATTENTION status by transfering it into ICCCM's urgency hint. I hope this is useful for others and perhaps this might even get included in the main repository. I know this is not perfect, but the code for _NET_WM_FULLSCREEN wasn't much worse than this. ;) Cheers, Uli -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQEcBAEBCAAGBQJMHTmzAAoJECLkKOvLj8sGKd0H/ReD9C3EotYNRXbJ9nYMk7qX kjYJ3bj6xgmhdgllCtHLb3S18Z4CzuiWXvIFJOiU2y3V/UmkGLGpbHNMgT/uaTbW YvRAbHilQQSHFlUTni0QJRyu4yei0xxp5xgoaXByp0CMRn79CYu73+fBdD9bDoOc J3O87WJn/r+U4rjW2fIYNs2CQuqWxokD9hHB3Psa5/wNEq57DVPiOFG+G1lbubrV pDSuxNjJO2XekkD89I1ZqKliiCcoxRt8LRjaQhCR3XbMngtzEs10qXqpcU9cQF/y kumbxC8SGBx7mIh018nITrJqAf4Dh4gpnSf6Wjp4KliDmkrfOqHFhoR48am+6r0= =lp/T -----END PGP SIGNATURE-----
--- dwm.c.orig 2010-06-19 13:39:11.764762684 +0200
+++ dwm.c 2010-06-19 13:50:19.664760498 +0200
@@ -58,7 +58,7 @@
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
enum { NetSupported, NetWMName, NetWMState,
- NetWMFullscreen, NetLast }; /* EWMH atoms */
+ NetWMFullscreen, NetWMDemandsAttention, NetLast }; /* EWMH atoms */
enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
@@ -1302,13 +1302,27 @@ void
clientmessage(XEvent *e) {
XClientMessageEvent *cme = &e->xclient;
- if(cme->message_type == netatom[NetWMState] && cme->data.l[1] == netatom[NetWMFullscreen]) {
- if(cme->data.l[0])
- XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32,
+ if(cme->message_type == netatom[NetWMState]) {
+ int set = (cme->data.l[0] != 0);
+ if (cme->data.l[1] == netatom[NetWMFullscreen]) {
+ if (set)
+ XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
- else
- XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32,
+ else
+ XChangeProperty(dpy, cme->window, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)0, 0);
+ }
+ if (cme->data.l[1] == netatom[NetWMDemandsAttention]) {
+ XWMHints *wmh;
+ if((wmh = XGetWMHints(dpy, cme->window))) {
+ if (set)
+ wmh->flags |= XUrgencyHint;
+ else
+ wmh->flags &= ~XUrgencyHint;
+ XSetWMHints(dpy, cme->window, wmh);
+ XFree(wmh);
+ }
+ }
}
}
@@ -1517,6 +1531,7 @@ setup(void) {
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
+ netatom[NetWMDemandsAttention] = XInternAtom(dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", False);
/* init cursors */
cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
dwm-demands_attention.patch.sig
Description: Binary data
