--- dwm.c.orig 2010-06-19 13:39:11.764762684 +0200 +++ dwm.c 2010-06-20 09:11:44.512261070 +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,24 @@ 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]) { + Bool set = (cme->data.l[0] != 0) ? True : False; + 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]) { + Client *c = wintoclient(cme->window); + if (!c) + return; + + c->isurgent = set; + drawbars(); + } } } @@ -1517,6 +1528,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);