summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--layout.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/layout.c b/layout.c
index 8005894..3746a88 100644
--- a/layout.c
+++ b/layout.c
@@ -15,7 +15,7 @@ static unsigned int nmaster = NMASTER;
15 15
16static void 16static void
17tile(void) { 17tile(void) {
18 unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th; 18 unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th, remain;
19 Client *c; 19 Client *c;
20 20
21 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) 21 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
@@ -24,6 +24,7 @@ tile(void) {
24 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1); 24 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
25 mw = (n > nmaster) ? (waw * masterw) / 1000 : waw; 25 mw = (n > nmaster) ? (waw * masterw) / 1000 : waw;
26 th = (n > nmaster) ? wah / (n - nmaster) : 0; 26 th = (n > nmaster) ? wah / (n - nmaster) : 0;
27 remain = (n > nmaster) ? wah - th * (n - nmaster) : 0;
27 tw = waw - mw; 28 tw = waw - mw;
28 29
29 for(i = 0, c = clients; c; c = c->next) 30 for(i = 0, c = clients; c; c = c->next)
@@ -46,10 +47,9 @@ tile(void) {
46 nw = tw - 2 * c->border; 47 nw = tw - 2 * c->border;
47 if(th > 2 * c->border) { 48 if(th > 2 * c->border) {
48 ny += (i - nmaster) * th; 49 ny += (i - nmaster) * th;
49 if(i == n - 1) 50 nh = th - 2 * c->border;
50 nh = wah - ny - 2 * c->border; 51 if (i == n - 1)
51 else 52 nh += remain;
52 nh = th - 2 * c->border;
53 } 53 }
54 else /* fallback if th <= 2 * c->border */ 54 else /* fallback if th <= 2 * c->border */
55 nh = wah - 2 * c->border; 55 nh = wah - 2 * c->border;