Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

28 lines
560 B

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