Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d5893f5
)
applied anydot's urgency hint patch, thanks!
author
anselm@aab <unknown>
Sun, 13 Jul 2008 17:08:55 +0000
(18:08 +0100)
committer
anselm@aab <unknown>
Sun, 13 Jul 2008 17:08:55 +0000
(18:08 +0100)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index
e077454
..
48785c7
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-139,6
+139,7
@@
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
static void cleanup(void);
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);
static void configure(Client *c);
static void configurenotify(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
configure(Client *c) {
XConfigureEvent ce;
void
configure(Client *c) {
XConfigureEvent ce;
@@
-1496,6
+1514,7
@@
toggleview(const Arg *arg) {
if(mask) {
tagset[seltags] = mask;
if(mask) {
tagset[seltags] = mask;
+ clearurgent();
arrange();
}
}
arrange();
}
}
@@
-1626,10
+1645,13
@@
updatewmhints(Client *c) {
XWMHints *wmh;
if((wmh = XGetWMHints(dpy, c->win))) {
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;
else
c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
+
XFree(wmh);
}
}
XFree(wmh);
}
}
@@
-1641,6
+1663,7
@@
view(const Arg *arg) {
seltags ^= 1; /* toggle sel tagset */
if(arg && (arg->ui & TAGMASK))
tagset[seltags] = arg->i & TAGMASK;
seltags ^= 1; /* toggle sel tagset */
if(arg && (arg->ui & TAGMASK))
tagset[seltags] = arg->i & TAGMASK;
+ clearurgent();
arrange();
}
arrange();
}