diff options
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/monsterwm.c b/monsterwm.c index 2f2dbec..421a1bc 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -1187,20 +1187,25 @@ void stack(int x, int y, int w, int h, const Desktop *d) { /* tile the first non-floating, non-fullscreen window to cover the master area */ if (b) XMoveResizeWindow(dis, c->win, x, y, w - 2*BORDER_WIDTH, ma - BORDER_WIDTH); - else if (r) XMoveResizeWindow(dis, c->win, w - ma + BORDER_WIDTH, y, ma, h - 2*BORDER_WIDTH); + else if (r) XMoveResizeWindow(dis, c->win, w - ma - BORDER_WIDTH, y, ma - BORDER_WIDTH, h - 2*BORDER_WIDTH); else XMoveResizeWindow(dis, c->win, x, y, ma - BORDER_WIDTH, h - 2*BORDER_WIDTH); - /* tile the next non-floating, non-fullscreen (and first) stack window adding p */ + /* tile the next non-floating, non-fullscreen (and first) stack window adding p - GAP_WIDTH */ for (c = c->next; c && ISFFT(c); c = c->next); - int cw = (b ? h:w) - 2*BORDER_WIDTH - ma, ch = z - BORDER_WIDTH; - if (b) XMoveResizeWindow(dis, c->win, x, y += ma, ch - BORDER_WIDTH + p, cw); - else XMoveResizeWindow(dis, c->win, r ? x : (x += ma), y, cw, ch - BORDER_WIDTH + p); + int cw = (b ? h:w) - 2*BORDER_WIDTH - ma - GAP_WIDTH, ch = z - BORDER_WIDTH; + if (b) { + XMoveResizeWindow(dis, c->win, x, (y += ma + GAP_WIDTH), ch - BORDER_WIDTH + p, cw); + x += GAP_WIDTH; + } else { + XMoveResizeWindow(dis, c->win, r ? x : (x += ma + GAP_WIDTH), y, cw, ch - BORDER_WIDTH + p); + y += GAP_WIDTH; + } /* tile the rest of the non-floating, non-fullscreen stack windows */ for (b ? (x += ch+p):(y += ch+p), c = c->next; c; c = c->next) { if (ISFFT(c)) continue; - if (b) { XMoveResizeWindow(dis, c->win, x, y, ch, cw); x += z; } - else { XMoveResizeWindow(dis, c->win, x, y, cw, ch); y += z; } + if (b) { XMoveResizeWindow(dis, c->win, x, y, ch - GAP_WIDTH, cw); x += z; } + else { XMoveResizeWindow(dis, c->win, x, y, cw, ch - GAP_WIDTH); y += z; } } } |
