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 | renamed eprint die (diff) | |
| download | dwm-9aa4a9043d1261f9ae71cc2740d061d68a99227e.tar.gz 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); | |||
| 139 | static void buttonpress(XEvent *e); | 139 | static void buttonpress(XEvent *e); |
| 140 | static void checkotherwm(void); | 140 | static void checkotherwm(void); |
| 141 | static void cleanup(void); | 141 | static void cleanup(void); |
| 142 | static void clearurgent(void); | ||
| 142 | static void configure(Client *c); | 143 | static void configure(Client *c); |
| 143 | static void configurenotify(XEvent *e); | 144 | static void configurenotify(XEvent *e); |
| 144 | static void configurerequest(XEvent *e); | 145 | static void configurerequest(XEvent *e); |
| @@ -375,6 +376,23 @@ cleanup(void) { | |||
| 375 | } | 376 | } |
| 376 | 377 | ||
| 377 | void | 378 | void |
| 379 | clearurgent(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 | |||
| 395 | void | ||
| 378 | configure(Client *c) { | 396 | configure(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 | ||
