applied anydot's urgency hint patch, thanks! 9aa4a904
anselm@aab · 2008-07-13 18:08 1 file(s) · +25 −2
dwm.c +25 −2
139 139
static void buttonpress(XEvent *e);
140 140
static void checkotherwm(void);
141 141
static void cleanup(void);
142 +
static void clearurgent(void);
142 143
static void configure(Client *c);
143 144
static void configurenotify(XEvent *e);
144 145
static void configurerequest(XEvent *e);
372 373
	XDestroyWindow(dpy, barwin);
373 374
	XSync(dpy, False);
374 375
	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
376 +
}
377 +
378 +
void
379 +
clearurgent(void) {
380 +
	XWMHints *wmh;
381 +
	Client *c;
382 +
383 +
	for(c = clients; c; c = c->next)
384 +
		if(ISVISIBLE(c) && c->isurgent) {
385 +
			c->isurgent = False;
386 +
			if (!(wmh = XGetWMHints(dpy, c->win)))
387 +
				continue;
388 +
389 +
			wmh->flags &= ~XUrgencyHint;
390 +
			XSetWMHints(dpy, c->win, wmh);
391 +
			XFree(wmh);
392 +
		}
375 393
}
376 394
377 395
void
1496 1514
1497 1515
	if(mask) {
1498 1516
		tagset[seltags] = mask;
1517 +
		clearurgent();
1499 1518
		arrange();
1500 1519
	}
1501 1520
}
1626 1645
	XWMHints *wmh;
1627 1646
1628 1647
	if((wmh = XGetWMHints(dpy, c->win))) {
1629 -
		if(c == sel)
1630 -
			sel->isurgent = False;
1648 +
		if(ISVISIBLE(c) && wmh->flags & XUrgencyHint) {
1649 +
			wmh->flags &= ~XUrgencyHint;
1650 +
			XSetWMHints(dpy, c->win, wmh);
1651 +
		}
1631 1652
		else
1632 1653
			c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
1654 +
1633 1655
		XFree(wmh);
1634 1656
	}
1635 1657
}
1641 1663
	seltags ^= 1; /* toggle sel tagset */
1642 1664
	if(arg && (arg->ui & TAGMASK))
1643 1665
		tagset[seltags] = arg->i & TAGMASK;
1666 +
	clearurgent();
1644 1667
	arrange();
1645 1668
}
1646 1669