You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
561 B
30 lines
561 B
3 years ago
|
void
|
||
|
switchcol(const Arg *arg)
|
||
|
{
|
||
|
Client *c, *t;
|
||
|
int col = 0;
|
||
|
int i;
|
||
|
|
||
|
if (!selmon->sel)
|
||
|
return;
|
||
|
for (i = 0, c = nexttiled(selmon->clients); c ;
|
||
|
c = nexttiled(c->next), i++) {
|
||
|
if (c == selmon->sel)
|
||
|
col = (i + 1) > selmon->nmaster;
|
||
|
}
|
||
|
if (i <= selmon->nmaster)
|
||
|
return;
|
||
|
for (c = selmon->stack; c; c = c->snext) {
|
||
|
if (!ISVISIBLE(c))
|
||
|
continue;
|
||
|
for (i = 0, t = nexttiled(selmon->clients); t && t != c;
|
||
|
t = nexttiled(t->next), i++);
|
||
|
if (t && (i + 1 > selmon->nmaster) != col) {
|
||
|
focus(c);
|
||
|
restack(selmon);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|