diff options
| -rw-r--r-- | dwm.c | 25 |
1 files changed, 10 insertions, 15 deletions
| @@ -138,7 +138,7 @@ static void attachstack(Client *c); | |||
| 138 | static void buttonpress(XEvent *e); | 138 | static void buttonpress(XEvent *e); |
| 139 | static void checkotherwm(void); | 139 | static void checkotherwm(void); |
| 140 | static void cleanup(void); | 140 | static void cleanup(void); |
| 141 | static void clearurgent(void); | 141 | static void clearurgent(Client *c); |
| 142 | static void configure(Client *c); | 142 | static void configure(Client *c); |
| 143 | static void configurenotify(XEvent *e); | 143 | static void configurenotify(XEvent *e); |
| 144 | static void configurerequest(XEvent *e); | 144 | static void configurerequest(XEvent *e); |
| @@ -365,20 +365,15 @@ cleanup(void) { | |||
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | void | 367 | void |
| 368 | clearurgent(void) { | 368 | clearurgent(Client *c) { |
| 369 | XWMHints *wmh; | 369 | XWMHints *wmh; |
| 370 | Client *c; | ||
| 371 | |||
| 372 | for(c = clients; c; c = c->next) | ||
| 373 | if(ISVISIBLE(c) && c->isurgent) { | ||
| 374 | c->isurgent = False; | ||
| 375 | if (!(wmh = XGetWMHints(dpy, c->win))) | ||
| 376 | continue; | ||
| 377 | 370 | ||
| 378 | wmh->flags &= ~XUrgencyHint; | 371 | c->isurgent = False; |
| 379 | XSetWMHints(dpy, c->win, wmh); | 372 | if(!(wmh = XGetWMHints(dpy, c->win))) |
| 380 | XFree(wmh); | 373 | return; |
| 381 | } | 374 | wmh->flags &= ~XUrgencyHint; |
| 375 | XSetWMHints(dpy, c->win, wmh); | ||
| 376 | XFree(wmh); | ||
| 382 | } | 377 | } |
| 383 | 378 | ||
| 384 | void | 379 | void |
| @@ -617,6 +612,8 @@ focus(Client *c) { | |||
| 617 | XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); | 612 | XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); |
| 618 | } | 613 | } |
| 619 | if(c) { | 614 | if(c) { |
| 615 | if(c->isurgent) | ||
| 616 | clearurgent(c); | ||
| 620 | detachstack(c); | 617 | detachstack(c); |
| 621 | attachstack(c); | 618 | attachstack(c); |
| 622 | grabbuttons(c, True); | 619 | grabbuttons(c, True); |
| @@ -1500,7 +1497,6 @@ toggleview(const Arg *arg) { | |||
| 1500 | 1497 | ||
| 1501 | if(mask) { | 1498 | if(mask) { |
| 1502 | tagset[seltags] = mask; | 1499 | tagset[seltags] = mask; |
| 1503 | clearurgent(); | ||
| 1504 | arrange(); | 1500 | arrange(); |
| 1505 | } | 1501 | } |
| 1506 | } | 1502 | } |
| @@ -1673,7 +1669,6 @@ view(const Arg *arg) { | |||
| 1673 | seltags ^= 1; /* toggle sel tagset */ | 1669 | seltags ^= 1; /* toggle sel tagset */ |
| 1674 | if(arg->ui & TAGMASK) | 1670 | if(arg->ui & TAGMASK) |
| 1675 | tagset[seltags] = arg->ui & TAGMASK; | 1671 | tagset[seltags] = arg->ui & TAGMASK; |
| 1676 | clearurgent(); | ||
| 1677 | arrange(); | 1672 | arrange(); |
| 1678 | } | 1673 | } |
| 1679 | 1674 | ||
