applied anydot's urgency hint patch, thanks!

master
anselm@aab 2008-07-13 18:08:55 +01:00
parent d5893f55be
commit 9aa4a9043d
1 changed files with 25 additions and 2 deletions

27
dwm.c
View File

@ -139,6 +139,7 @@ static void attachstack(Client *c);
static void buttonpress(XEvent *e); static void buttonpress(XEvent *e);
static void checkotherwm(void); static void checkotherwm(void);
static void cleanup(void); static void cleanup(void);
static void clearurgent(void);
static void configure(Client *c); static void configure(Client *c);
static void configurenotify(XEvent *e); static void configurenotify(XEvent *e);
static void configurerequest(XEvent *e); static void configurerequest(XEvent *e);
@ -374,6 +375,23 @@ cleanup(void) {
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); 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 void
configure(Client *c) { configure(Client *c) {
XConfigureEvent ce; XConfigureEvent ce;
@ -1496,6 +1514,7 @@ toggleview(const Arg *arg) {
if(mask) { if(mask) {
tagset[seltags] = mask; tagset[seltags] = mask;
clearurgent();
arrange(); arrange();
} }
} }
@ -1626,10 +1645,13 @@ updatewmhints(Client *c) {
XWMHints *wmh; XWMHints *wmh;
if((wmh = XGetWMHints(dpy, c->win))) { if((wmh = XGetWMHints(dpy, c->win))) {
if(c == sel) if(ISVISIBLE(c) && wmh->flags & XUrgencyHint) {
sel->isurgent = False; wmh->flags &= ~XUrgencyHint;
XSetWMHints(dpy, c->win, wmh);
}
else else
c->isurgent = (wmh->flags & XUrgencyHint) ? True : False; c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
XFree(wmh); XFree(wmh);
} }
} }
@ -1641,6 +1663,7 @@ view(const Arg *arg) {
seltags ^= 1; /* toggle sel tagset */ seltags ^= 1; /* toggle sel tagset */
if(arg && (arg->ui & TAGMASK)) if(arg && (arg->ui & TAGMASK))
tagset[seltags] = arg->i & TAGMASK; tagset[seltags] = arg->i & TAGMASK;
clearurgent();
arrange(); arrange();
} }