diff options
author | anselm@aab <unknown> | 2008-07-13 18:08:55 +0100 |
---|---|---|
committer | anselm@aab <unknown> | 2008-07-13 18:08:55 +0100 |
commit | 9aa4a9043d1261f9ae71cc2740d061d68a99227e (patch) | |
tree | 8a815a1d753f471d31104cfb5ccf063f139fcbe0 /dwm.c | |
parent | d5893f55bec202e5dbb5ca4ef1f205cec5eb22c6 (diff) | |
download | dwm-9aa4a9043d1261f9ae71cc2740d061d68a99227e.tar.gz dwm-9aa4a9043d1261f9ae71cc2740d061d68a99227e.tar.bz2 dwm-9aa4a9043d1261f9ae71cc2740d061d68a99227e.zip |
applied anydot's urgency hint patch, thanks!
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -139,6 +139,7 @@ static void attachstack(Client *c); static void buttonpress(XEvent *e); static void checkotherwm(void); static void cleanup(void); +static void clearurgent(void); static void configure(Client *c); static void configurenotify(XEvent *e); static void configurerequest(XEvent *e); @@ -375,6 +376,23 @@ cleanup(void) { } void +clearurgent(void) { + XWMHints *wmh; + Client *c; + + for(c = clients; c; c = c->next) + if(ISVISIBLE(c) && c->isurgent) { + c->isurgent = False; + if (!(wmh = XGetWMHints(dpy, c->win))) + continue; + + wmh->flags &= ~XUrgencyHint; + XSetWMHints(dpy, c->win, wmh); + XFree(wmh); + } +} + +void configure(Client *c) { XConfigureEvent ce; @@ -1496,6 +1514,7 @@ toggleview(const Arg *arg) { if(mask) { tagset[seltags] = mask; + clearurgent(); arrange(); } } @@ -1626,10 +1645,13 @@ updatewmhints(Client *c) { XWMHints *wmh; if((wmh = XGetWMHints(dpy, c->win))) { - if(c == sel) - sel->isurgent = False; + if(ISVISIBLE(c) && wmh->flags & XUrgencyHint) { + wmh->flags &= ~XUrgencyHint; + XSetWMHints(dpy, c->win, wmh); + } else c->isurgent = (wmh->flags & XUrgencyHint) ? True : False; + XFree(wmh); } } @@ -1641,6 +1663,7 @@ view(const Arg *arg) { seltags ^= 1; /* toggle sel tagset */ if(arg && (arg->ui & TAGMASK)) tagset[seltags] = arg->i & TAGMASK; + clearurgent(); arrange(); } |