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.

42 lines
934 B

  1. void
  2. attachx(Client *c)
  3. {
  4. #if ATTACHABOVE_PATCH
  5. Client *at;
  6. if (!(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating)) {
  7. for (at = c->mon->clients; at->next != c->mon->sel; at = at->next);
  8. c->next = at->next;
  9. at->next = c;
  10. return;
  11. }
  12. #elif ATTACHASIDE_PATCH
  13. Client *at;
  14. unsigned int n;
  15. for (at = c->mon->clients, n = 0; at; at = at->next)
  16. if (!at->isfloating && ISVISIBLEONTAG(at, c->tags))
  17. if (++n >= c->mon->nmaster)
  18. break;
  19. if (at && c->mon->nmaster) {
  20. c->next = at->next;
  21. at->next = c;
  22. return;
  23. }
  24. #elif ATTACHBELOW_PATCH
  25. if (!(c->mon->sel == NULL || c->mon->sel == c || c->mon->sel->isfloating)) {
  26. c->next = c->mon->sel->next;
  27. c->mon->sel->next = c;
  28. return;
  29. }
  30. #elif ATTACHBOTTOM_PATCH
  31. Client *at;
  32. for (at = c->mon->clients; at && at->next; at = at->next);
  33. if (at) {
  34. at->next = c;
  35. c->next = NULL;
  36. return;
  37. }
  38. #endif
  39. attach(c); // master (default)
  40. }