summaryrefslogtreecommitdiffhomepage
path: root/patch/distributetags.c
blob: f20f53f67cc669791dfc3b924760db7b12ccdc69 (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
distributetags(const Arg *arg)
{
	Client *c;
	unsigned int ui = 1;
	int i = 0;

	#if TAGSYNC_PATCH
	Monitor *origselmon = selmon;
	for (selmon = mons; selmon; selmon = selmon->next) {
	#endif // TAGSYNC_PATCH

	for (c = selmon->clients; c; c = c->next) {
		if (HIDDEN(c))
			continue;
		if (!(c->tags & TAGMASK))
			continue;
		c->tags = (ui << i) & TAGMASK;
		i = (i + 1) % NUMTAGS;
	}

	#if TAGSYNC_PATCH
	}
	selmon = origselmon;
	focus(NULL);
	arrange(NULL);
	#else
	focus(NULL);
	arrange(selmon);
	#endif // TAGSYNC_PATCH
}