~kris/suckless

dwm

ref: bdace33fc79457c4ad8103b5e1bd18ded3bd2976 dwm/patch/transferall.c -rw-r--r-- 469 bytes
bdace33f — Kris Yotam Add Mod+Shift+S screenshot, Mod+/ dkymap, remove sticky bind 6 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
void
transferall(const Arg *arg)
{
	Client *c, *n = selmon->clients, *attachfrom = NULL;
	int i = 0, nstackclients = 0;
	while (n) {
		c = n;
		n = c->next;
		if (!ISVISIBLE(c) || c->isfloating) continue;
		if (i >= selmon->nmaster) {
			detach(c);
			if (!attachfrom) {
				attach(c);
			} else {
				c->next = attachfrom->next;
				attachfrom->next = c;
			}
			attachfrom = c;
			nstackclients++;
		}
		i++;
	}
	selmon->nmaster = nstackclients;
	arrange(selmon);
}