summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-05-19 14:44:53 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-05-19 14:44:53 +0100
commit4a5c8d84dbf410b8b9aa4dc81954568f10ca104f (patch)
tree81566dbab92ca5487e5ce84fa340a0f31bd2b0a9
parentonly snap within window area (diff)
downloaddwm-4a5c8d84dbf410b8b9aa4dc81954568f10ca104f.tar.gz
dwm-4a5c8d84dbf410b8b9aa4dc81954568f10ca104f.zip
improving space usage if master is left of stack (default)
-rw-r--r--tile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tile.c b/tile.c
index 6a58282..8269676 100644
--- a/tile.c
+++ b/tile.c
@@ -26,7 +26,7 @@ setmfact(const char *arg) {
26 26
27void 27void
28tile(void) { 28tile(void) {
29 int y, h; 29 int x, y, h, w;
30 unsigned int i, n; 30 unsigned int i, n;
31 Client *c; 31 Client *c;
32 32
@@ -46,16 +46,18 @@ tile(void) {
46 return; 46 return;
47 47
48 /* tile stack */ 48 /* tile stack */
49 x = (tx > c->x + c->w) ? c->x + c->w + 2 * c->bw : tw;
49 y = ty; 50 y = ty;
51 w = (tx > c->x + c->w) ? wx + ww - x : tw;
50 h = th / n; 52 h = th / n;
51 if(h < bh) 53 if(h < bh)
52 h = th; 54 h = th;
53 55
54 for(i = 0, c = nextunfloating(c->next); c; c = nextunfloating(c->next), i++) { 56 for(i = 0, c = nextunfloating(c->next); c; c = nextunfloating(c->next), i++) {
55 if(i + 1 == n) /* remainder */ 57 if(i + 1 == n) /* remainder */
56 tileresize(c, tx, y, tw - 2 * c->bw, (ty + th) - y - 2 * c->bw); 58 tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw);
57 else 59 else
58 tileresize(c, tx, y, tw - 2 * c->bw, h - 2 * c->bw); 60 tileresize(c, x, y, w - 2 * c->bw, h - 2 * c->bw);
59 if(h != th) 61 if(h != th)
60 y = c->y + c->h + 2 * c->bw; 62 y = c->y + c->h + 2 * c->bw;
61 } 63 }