~kris/suckless

dwm

ref: 556b5fa40e27afcbdce9e4b7375b33bdd9f1a69f dwm/patch/killunsel.c -rw-r--r-- 597 bytes
556b5fa4 — Kris Yotam swap focused/unfocused border colors: pale cyan focused, teal unfocused 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
void
killunsel(const Arg *arg)
{
	Client *i = NULL;

	if (!selmon->sel)
		return;

	for (i = selmon->clients; i; i = i->next) {
		if (ISVISIBLE(i) && i != selmon->sel) {
			#if BAR_SYSTRAY_PATCH
			if (!sendevent(i->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0))
			#else
			if (!sendevent(i, wmatom[WMDelete]))
			#endif // BAR_SYSTRAY_PATCH
			{
				XGrabServer(dpy);
				XSetErrorHandler(xerrordummy);
				XSetCloseDownMode(dpy, DestroyAll);
				XKillClient(dpy, i->win);
				XSync(dpy, False);
				XSetErrorHandler(xerror);
				XUngrabServer(dpy);
			}
		}
	}
}