integrated yiyus clearurgent refactoring
fbce7335
1 file(s) · +10 −15
| 138 | 138 | static void buttonpress(XEvent *e); |
|
| 139 | 139 | static void checkotherwm(void); |
|
| 140 | 140 | static void cleanup(void); |
|
| 141 | - | static void clearurgent(void); |
|
| 141 | + | static void clearurgent(Client *c); |
|
| 142 | 142 | static void configure(Client *c); |
|
| 143 | 143 | static void configurenotify(XEvent *e); |
|
| 144 | 144 | static void configurerequest(XEvent *e); |
|
| 365 | 365 | } |
|
| 366 | 366 | ||
| 367 | 367 | void |
|
| 368 | - | clearurgent(void) { |
|
| 368 | + | clearurgent(Client *c) { |
|
| 369 | 369 | XWMHints *wmh; |
|
| 370 | - | Client *c; |
|
| 371 | 370 | ||
| 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 | - | ||
| 378 | - | wmh->flags &= ~XUrgencyHint; |
|
| 379 | - | XSetWMHints(dpy, c->win, wmh); |
|
| 380 | - | XFree(wmh); |
|
| 381 | - | } |
|
| 371 | + | c->isurgent = False; |
|
| 372 | + | if(!(wmh = XGetWMHints(dpy, c->win))) |
|
| 373 | + | return; |
|
| 374 | + | wmh->flags &= ~XUrgencyHint; |
|
| 375 | + | XSetWMHints(dpy, c->win, wmh); |
|
| 376 | + | XFree(wmh); |
|
| 382 | 377 | } |
|
| 383 | 378 | ||
| 384 | 379 | void |
|
| 617 | 612 | XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); |
|
| 618 | 613 | } |
|
| 619 | 614 | if(c) { |
|
| 615 | + | if(c->isurgent) |
|
| 616 | + | clearurgent(c); |
|
| 620 | 617 | detachstack(c); |
|
| 621 | 618 | attachstack(c); |
|
| 622 | 619 | grabbuttons(c, True); |
|
| 1500 | 1497 | ||
| 1501 | 1498 | if(mask) { |
|
| 1502 | 1499 | tagset[seltags] = mask; |
|
| 1503 | - | clearurgent(); |
|
| 1504 | 1500 | arrange(); |
|
| 1505 | 1501 | } |
|
| 1506 | 1502 | } |
|
| 1673 | 1669 | seltags ^= 1; /* toggle sel tagset */ |
|
| 1674 | 1670 | if(arg->ui & TAGMASK) |
|
| 1675 | 1671 | tagset[seltags] = arg->ui & TAGMASK; |
|
| 1676 | - | clearurgent(); |
|
| 1677 | 1672 | arrange(); |
|
| 1678 | 1673 | } |
|
| 1679 | 1674 | ||