summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/dwm.c b/dwm.c
index f7b9477..ff71194 100644
--- a/dwm.c
+++ b/dwm.c
@@ -138,7 +138,7 @@ static void attachstack(Client *c);
138static void buttonpress(XEvent *e); 138static void buttonpress(XEvent *e);
139static void checkotherwm(void); 139static void checkotherwm(void);
140static void cleanup(void); 140static void cleanup(void);
141static void clearurgent(void); 141static void clearurgent(Client *c);
142static void configure(Client *c); 142static void configure(Client *c);
143static void configurenotify(XEvent *e); 143static void configurenotify(XEvent *e);
144static void configurerequest(XEvent *e); 144static void configurerequest(XEvent *e);
@@ -365,20 +365,15 @@ cleanup(void) {
365} 365}
366 366
367void 367void
368clearurgent(void) { 368clearurgent(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
384void 379void
@@ -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