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.

40 lines
977 B

  1. static void
  2. tile(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. mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1);
  17. sh = m->wh - 2*oh - ih * (n - m->nmaster - 1);
  18. sw = mw = m->ww - 2*ov;
  19. if (m->nmaster && n > m->nmaster) {
  20. sw = (mw - iv) * (1 - m->mfact);
  21. mw = (mw - iv) * m->mfact;
  22. sx = mx + mw + iv;
  23. }
  24. getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest);
  25. for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
  26. if (i < m->nmaster) {
  27. resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0);
  28. my += HEIGHT(c) + ih;
  29. } else {
  30. resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0);
  31. sy += HEIGHT(c) + ih;
  32. }
  33. }