timprove tile spacing - dwm - [fork] customized build of dwm, the dynamic windo… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 2420071f4c595438f3be9b476fcc23142624c50c | |
parent 04c26574b8567048ceec60142878318aa9081cb1 | |
Author: Connor Lane Smith <[email protected]> | |
Date: Fri, 28 Oct 2011 23:45:12 +0100 | |
improve tile spacing | |
Diffstat: | |
M dwm.c | 21 ++++++++++++--------- | |
1 file changed, 12 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/dwm.c b/dwm.c | |
t@@ -1659,23 +1659,26 @@ textnw(const char *text, unsigned int len) { | |
void | |
tile(Monitor *m) { | |
- unsigned int i, n, mw, mh, tw, th; | |
+ unsigned int i, n, h, mw, my, ty; | |
Client *c; | |
for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); | |
if(n == 0) | |
return; | |
- mh = (n > m->nmaster) ? m->wh / m->nmaster : m->wh / n; | |
mw = (n > m->nmaster) ? m->ww * m->mfact : m->ww; | |
- th = (n > m->nmaster) ? m->wh / (n - m->nmaster) : 0; | |
- tw = m->ww - mw; | |
- for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) | |
- if(i < m->nmaster) | |
- resize(c, m->wx, m->wy + (i*mh), mw - (2*c->bw), mh - … | |
- else | |
- resize(c, m->wx + mw, m->wy + ((i - m->nmaster)*th), t… | |
+ for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->ne… | |
+ if(i < m->nmaster) { | |
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i); | |
+ resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c-… | |
+ my += HEIGHT(c); | |
+ } | |
+ else { | |
+ h = (m->wh - ty) / (n - i); | |
+ resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->b… | |
+ ty += HEIGHT(c); | |
+ } | |
} | |
void |