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
1005 B

  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. int oh, ov, ih, iv;
  11. getgaps(m, &oh, &ov, &ih, &iv, &n);
  12. if (n == 0)
  13. return;
  14. sx = mx = m->wx + ov;
  15. sy = my = m->wy + oh;
  16. sh = mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1);
  17. sw = mw = m->ww - 2*ov;
  18. if (m->nmaster && n > m->nmaster) {
  19. sw = (mw - iv) * (1 - m->mfact);
  20. mw = (mw - iv) * m->mfact;
  21. sx = mx + mw + iv;
  22. sh = m->wh - 2*oh;
  23. }
  24. getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest);
  25. if (n - m->nmaster > 0) /* override layout symbol */
  26. snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", n - m->nmaster);
  27. for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
  28. if (i < m->nmaster) {
  29. resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0);
  30. my += HEIGHT(c) + ih;
  31. } else {
  32. resize(c, sx, sy, sw - (2*c->bw), sh - (2*c->bw), 0);
  33. }
  34. }