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.

75 lines
1.8 KiB

  1. static void
  2. bstackhoriz(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. mh = m->wh - 2*oh;
  22. sh = m->wh - 2*oh - ih * (n - m->nmaster - 1);
  23. mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1);
  24. sw = m->ww - 2*ov;
  25. if (m->nmaster && n > m->nmaster) {
  26. sh = (mh - ih) * (1 - m->mfact);
  27. mh = (mh - ih) * m->mfact;
  28. sy = my + mh + ih;
  29. sh = m->wh - mh - 2*oh - ih * (n - m->nmaster);
  30. }
  31. #else
  32. sx = mx = m->wx;
  33. sy = my = m->wy;
  34. sh = mh = m->wh;
  35. sw = mw = m->ww;
  36. if (m->nmaster && n > m->nmaster) {
  37. sh = mh * (1 - m->mfact);
  38. mh = mh * m->mfact;
  39. sy = my + mh;
  40. sh = m->wh - mh;
  41. }
  42. #endif // VANITYGAPS_PATCH
  43. getfacts(m, mw, sh, &mfacts, &sfacts, &mrest, &srest);
  44. for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
  45. if (i < m->nmaster) {
  46. #if CFACTS_PATCH
  47. resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
  48. #else
  49. resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
  50. #endif // CFACTS_PATCH
  51. #if VANITYGAPS_PATCH
  52. mx += WIDTH(c) + iv;
  53. #else
  54. mx += WIDTH(c);
  55. #endif
  56. } else {
  57. #if CFACTS_PATCH
  58. resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0);
  59. #else
  60. resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0);
  61. #endif // CFACTS_PATCH
  62. #if VANITYGAPS_PATCH
  63. sy += HEIGHT(c) + ih;
  64. #else
  65. sy += HEIGHT(c);
  66. #endif
  67. }
  68. }
  69. }