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.

23 lines
722 B

  1. void
  2. getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr)
  3. {
  4. unsigned int n;
  5. float mfacts, sfacts;
  6. int mtotal = 0, stotal = 0;
  7. Client *c;
  8. for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
  9. mfacts = MIN(n, m->nmaster);
  10. sfacts = n - m->nmaster;
  11. for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++)
  12. if (n < m->nmaster)
  13. mtotal += msize / mfacts;
  14. else
  15. stotal += ssize / sfacts;
  16. *mf = mfacts; // total factor of master area
  17. *sf = sfacts; // total factor of stack area
  18. *mr = msize - mtotal; // the remainder (rest) of pixels after an even master split
  19. *sr = ssize - stotal; // the remainder (rest) of pixels after an even stack split
  20. }