dwm-flexipatch/patch/transferall.c

25 lines
467 B
C
Raw Normal View History

2020-02-02 10:55:19 +00:00
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);
}