summaryrefslogtreecommitdiffhomepage
path: root/patch/tagallmon.c
blob: 51af14240638aa173c6251301a85cb3dafb395ce (plain)
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
29
30
31
void
tagallmon(const Arg *arg)
{
	Monitor *m;
	Client *c;
	Client *next;

	if (!mons->next)
		return;

	m = dirtomon(arg->i);
	for (c = selmon->clients; c; c = next) {
		next = c->next;
		if (!ISVISIBLE(c))
			continue;
		unfocus(c, 1);
		detach(c);
		detachstack(c);
		c->mon = m;
		c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
		attach(c);
		attachstack(c);
		if (c->isfullscreen) {
			setfullscreen(c, 0);
			setfullscreen(c, 1);
		}
	}

	focus(NULL);
	arrange(NULL);
}