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.

41 lines
1.1 KiB

  1. void
  2. shiftviewclients(const Arg *arg)
  3. {
  4. Arg shifted;
  5. Client *c;
  6. unsigned int tagmask = 0;
  7. for (c = selmon->clients; c; c = c->next)
  8. #if SCRATCHPADS_PATCH
  9. if (!(c->tags & SPTAGMASK))
  10. tagmask = tagmask | c->tags;
  11. #elif SCRATCHPAD_ALT_1_PATCH
  12. if (!(c->tags & SCRATCHPAD_MASK))
  13. tagmask = tagmask | c->tags;
  14. #else
  15. tagmask = tagmask | c->tags;
  16. #endif // SCRATCHPADS_PATCH
  17. #if SCRATCHPADS_PATCH
  18. shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
  19. #else
  20. shifted.ui = selmon->tagset[selmon->seltags];
  21. #endif // SCRATCHPADS_PATCH
  22. if (arg->i > 0) // left circular shift
  23. do {
  24. shifted.ui = (shifted.ui << arg->i)
  25. | (shifted.ui >> (NUMTAGS - arg->i));
  26. #if SCRATCHPADS_PATCH
  27. shifted.ui &= ~SPTAGMASK;
  28. #endif // SCRATCHPADS_PATCH
  29. } while (tagmask && !(shifted.ui & tagmask));
  30. else // right circular shift
  31. do {
  32. shifted.ui = (shifted.ui >> (- arg->i)
  33. | shifted.ui << (NUMTAGS + arg->i));
  34. #if SCRATCHPADS_PATCH
  35. shifted.ui &= ~SPTAGMASK;
  36. #endif // SCRATCHPADS_PATCH
  37. } while (tagmask && !(shifted.ui & tagmask));
  38. view(&shifted);
  39. }