summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index e077454..48785c7 100644
--- a/dwm.c
+++ b/dwm.c
@@ -139,6 +139,7 @@ static void attachstack(Client *c);
139static void buttonpress(XEvent *e); 139static void buttonpress(XEvent *e);
140static void checkotherwm(void); 140static void checkotherwm(void);
141static void cleanup(void); 141static void cleanup(void);
142static void clearurgent(void);
142static void configure(Client *c); 143static void configure(Client *c);
143static void configurenotify(XEvent *e); 144static void configurenotify(XEvent *e);
144static void configurerequest(XEvent *e); 145static void configurerequest(XEvent *e);
@@ -375,6 +376,23 @@ cleanup(void) {
375} 376}
376 377
377void 378void
379clearurgent(void) {
380 XWMHints *wmh;
381 Client *c;
382
383 for(c = clients; c; c = c->next)
384 if(ISVISIBLE(c) && c->isurgent) {
385 c->isurgent = False;
386 if (!(wmh = XGetWMHints(dpy, c->win)))
387 continue;
388
389 wmh->flags &= ~XUrgencyHint;
390 XSetWMHints(dpy, c->win, wmh);
391 XFree(wmh);
392 }
393}
394
395void
378configure(Client *c) { 396configure(Client *c) {
379 XConfigureEvent ce; 397 XConfigureEvent ce;
380 398
@@ -1496,6 +1514,7 @@ toggleview(const Arg *arg) {
1496 1514
1497 if(mask) { 1515 if(mask) {
1498 tagset[seltags] = mask; 1516 tagset[seltags] = mask;
1517 clearurgent();
1499 arrange(); 1518 arrange();
1500 } 1519 }
1501} 1520}
@@ -1626,10 +1645,13 @@ updatewmhints(Client *c) {
1626 XWMHints *wmh; 1645 XWMHints *wmh;
1627 1646
1628 if((wmh = XGetWMHints(dpy, c->win))) { 1647 if((wmh = XGetWMHints(dpy, c->win))) {
1629 if(c == sel) 1648 if(ISVISIBLE(c) && wmh->flags & XUrgencyHint) {
1630 sel->isurgent = False; 1649 wmh->flags &= ~XUrgencyHint;
1650 XSetWMHints(dpy, c->win, wmh);
1651 }
1631 else 1652 else
1632 c->isurgent = (wmh->flags & XUrgencyHint) ? True : False; 1653 c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
1654
1633 XFree(wmh); 1655 XFree(wmh);
1634 } 1656 }
1635} 1657}
@@ -1641,6 +1663,7 @@ view(const Arg *arg) {
1641 seltags ^= 1; /* toggle sel tagset */ 1663 seltags ^= 1; /* toggle sel tagset */
1642 if(arg && (arg->ui & TAGMASK)) 1664 if(arg && (arg->ui & TAGMASK))
1643 tagset[seltags] = arg->i & TAGMASK; 1665 tagset[seltags] = arg->i & TAGMASK;
1666 clearurgent();
1644 arrange(); 1667 arrange();
1645} 1668}
1646 1669