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.

73 lines
1.8 KiB

  1. static void
  2. bstack(Monitor *m)
  3. {
  4. unsigned int i, n;
  5. int mx = 0, my = 0, mh = 0, mw = 0;
  6. int sx = 0, sy = 0, sh = 0, sw = 0;
  7. float mfacts, sfacts;
  8. int mrest, srest;
  9. Client *c;
  10. #if VANITYGAPS_PATCH
  11. int oh, ov, ih, iv;
  12. getgaps(m, &oh, &ov, &ih, &iv, &n);
  13. #else
  14. for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
  15. #endif // VANITYGAPS_PATCH
  16. if (n == 0)
  17. return;
  18. #if VANITYGAPS_PATCH
  19. sx = mx = m->wx + ov;
  20. sy = my = m->wy + oh;
  21. sh = mh = m->wh - 2*oh;
  22. mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1);
  23. sw = m->ww - 2*ov - iv * (n - m->nmaster - 1);
  24. if (m->nmaster && n > m->nmaster) {
  25. sh = (mh - ih) * (1 - m->mfact);
  26. mh = (mh - ih) * m->mfact;
  27. sx = mx;
  28. sy = my + mh + ih;
  29. }
  30. #else
  31. sx = mx = m->wx;
  32. sy = my = m->wy;
  33. sh = mh = m->wh;
  34. sw = mw = m->ww;
  35. if (m->nmaster && n > m->nmaster) {
  36. sh = mh * (1 - m->mfact);
  37. mh = mh * m->mfact;
  38. sy = my + mh;
  39. }
  40. #endif // VANITYGAPS_PATCH
  41. getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest);
  42. for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
  43. if (i < m->nmaster) {
  44. #if CFACTS_PATCH
  45. resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
  46. #else
  47. resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
  48. #endif // CFACTS_PATCH
  49. #if VANITYGAPS_PATCH
  50. mx += WIDTH(c) + iv;
  51. #else
  52. mx += WIDTH(c);
  53. #endif
  54. } else {
  55. #if CFACTS_PATCH
  56. resize(c, sx, sy, (sw / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0);
  57. #else
  58. resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0);
  59. #endif // CFACTS_PATCH
  60. #if VANITYGAPS_PATCH
  61. sx += WIDTH(c) + iv;
  62. #else
  63. sx += WIDTH(c);
  64. #endif
  65. }
  66. }
  67. }