switchcol.c (561B)
1 void 2 switchcol(const Arg *arg) 3 { 4 Client *c, *t; 5 int col = 0; 6 int i; 7 8 if (!selmon->sel) 9 return; 10 for (i = 0, c = nexttiled(selmon->clients); c ; 11 c = nexttiled(c->next), i++) { 12 if (c == selmon->sel) 13 col = (i + 1) > selmon->nmaster; 14 } 15 if (i <= selmon->nmaster) 16 return; 17 for (c = selmon->stack; c; c = c->snext) { 18 if (!ISVISIBLE(c)) 19 continue; 20 for (i = 0, t = nexttiled(selmon->clients); t && t != c; 21 t = nexttiled(t->next), i++); 22 if (t && (i + 1 > selmon->nmaster) != col) { 23 focus(c); 24 restack(selmon); 25 break; 26 } 27 } 28 } 29