changeset: 1366:335301ed102f
tag: tip
user: Anselm R Garbe <garbeam_AT_gmail.com>
date: Sat Dec 06 09:32:32 2008 +0000
files: dwm.c
description:
integrated yiyus clearurgent refactoring
diff -r b34298951f7b -r 335301ed102f dwm.c
--- a/dwm.c Sat Dec 06 09:16:48 2008 +0000
+++ b/dwm.c Sat Dec 06 09:32:32 2008 +0000
@@ -138,7 +138,7 @@
static void buttonpress(XEvent *e);
static void checkotherwm(void);
static void cleanup(void);
-static void clearurgent(void);
+static void clearurgent(Client *c);
static void configure(Client *c);
static void configurenotify(XEvent *e);
static void configurerequest(XEvent *e);
@@ -365,20 +365,15 @@
}
void
-clearurgent(void) {
+clearurgent(Client *c) {
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);
- }
+ c->isurgent = False;
+ if(!(wmh = XGetWMHints(dpy, c->win)))
+ return;
+ wmh->flags &= ~XUrgencyHint;
+ XSetWMHints(dpy, c->win, wmh);
+ XFree(wmh);
}
void
@@ -617,6 +612,8 @@
XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
}
if(c) {
+ if(c->isurgent)
+ clearurgent(c);
detachstack(c);
attachstack(c);
grabbuttons(c, True);
@@ -1500,7 +1497,6 @@
if(mask) {
tagset[seltags] = mask;
- clearurgent();
arrange();
}
}
@@ -1673,7 +1669,6 @@
seltags ^= 1; /* toggle sel tagset */
if(arg->ui & TAGMASK)
tagset[seltags] = arg->ui & TAGMASK;
- clearurgent();
arrange();
}
Received on Sat Dec 06 2008 - 09:32:37 UTC
This archive was generated by hypermail 2.2.0 : Sat Dec 06 2008 - 09:36:06 UTC