summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index a58eb2a..cce215a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1659,23 +1659,26 @@ textnw(const char *text, unsigned int len) {
1659 1659
1660void 1660void
1661tile(Monitor *m) { 1661tile(Monitor *m) {
1662 unsigned int i, n, mw, mh, tw, th; 1662 unsigned int i, n, h, mw, my, ty;
1663 Client *c; 1663 Client *c;
1664 1664
1665 for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 1665 for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
1666 if(n == 0) 1666 if(n == 0)
1667 return; 1667 return;
1668 1668
1669 mh = (n > m->nmaster) ? m->wh / m->nmaster : m->wh / n;
1670 mw = (n > m->nmaster) ? m->ww * m->mfact : m->ww; 1669 mw = (n > m->nmaster) ? m->ww * m->mfact : m->ww;
1671 th = (n > m->nmaster) ? m->wh / (n - m->nmaster) : 0;
1672 tw = m->ww - mw;
1673 1670
1674 for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 1671 for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
1675 if(i < m->nmaster) 1672 if(i < m->nmaster) {
1676 resize(c, m->wx, m->wy + (i*mh), mw - (2*c->bw), mh - (2*c->bw), False); 1673 h = (m->wh - my) / (MIN(n, m->nmaster) - i);
1677 else 1674 resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
1678 resize(c, m->wx + mw, m->wy + ((i - m->nmaster)*th), tw - (2*c->bw), th - (2*c->bw), False); 1675 my += HEIGHT(c);
1676 }
1677 else {
1678 h = (m->wh - ty) / (n - i);
1679 resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
1680 ty += HEIGHT(c);
1681 }
1679} 1682}
1680 1683
1681void 1684void