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.

65 lines
1.6 KiB

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