about summary refs log tree commit diff stats
path: root/tile.c
diff options
context:
space:
mode:
Diffstat (limited to 'tile.c')
-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) {
 
 void
 tile(void) {
-	int y, h;
+	int x, y, h, w;
 	unsigned int i, n;
 	Client *c;
 
@@ -46,16 +46,18 @@ tile(void) {
 		return;
 
 	/* tile stack */
+	x = (tx > c->x + c->w) ? c->x + c->w + 2 * c->bw : tw;
 	y = ty;
+	w = (tx > c->x + c->w) ? wx + ww - x : tw;
 	h = th / n;
 	if(h < bh)
 		h = th;
 
 	for(i = 0, c = nextunfloating(c->next); c; c = nextunfloating(c->next), i++) {
 		if(i + 1 == n) /* remainder */
-			tileresize(c, tx, y, tw - 2 * c->bw, (ty + th) - y - 2 * c->bw);
+			tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw);
 		else
-			tileresize(c, tx, y, tw - 2 * c->bw, h - 2 * c->bw);
+			tileresize(c, x, y, w - 2 * c->bw, h - 2 * c->bw);
 		if(h != th)
 			y = c->y + c->h + 2 * c->bw;
 	}
2 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181