static void buttonpress(XEvent *e);
static void checkotherwm(void);
static void cleanup(void);
+static void clearurgent(void);
static void configure(Client *c);
static void configurenotify(XEvent *e);
static void configurerequest(XEvent *e);
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
}
+void
+clearurgent(void) {
+ XWMHints *wmh;
+ Client *c;
+
+ for(c = clients; c; c = c->next)
+ if(ISVISIBLE(c) && c->isurgent) {
+ c->isurgent = False;
+ if (!(wmh = XGetWMHints(dpy, c->win)))
+ continue;
+
+ wmh->flags &= ~XUrgencyHint;
+ XSetWMHints(dpy, c->win, wmh);
+ XFree(wmh);
+ }
+}
+
void
configure(Client *c) {
XConfigureEvent ce;
if(mask) {
tagset[seltags] = mask;
+ clearurgent();
arrange();
}
}
XWMHints *wmh;
if((wmh = XGetWMHints(dpy, c->win))) {
- if(c == sel)
- sel->isurgent = False;
+ if(ISVISIBLE(c) && wmh->flags & XUrgencyHint) {
+ wmh->flags &= ~XUrgencyHint;
+ XSetWMHints(dpy, c->win, wmh);
+ }
else
c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
+
XFree(wmh);
}
}
seltags ^= 1; /* toggle sel tagset */
if(arg && (arg->ui & TAGMASK))
tagset[seltags] = arg->i & TAGMASK;
+ clearurgent();
arrange();
}