From 154571b65b58e60744bf284bfee9fccccfc1e2c5 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Fri, 9 Mar 2012 11:13:43 +0100 Subject: [PATCH] Add dimmer shift in split size of layout split to keep parent at closing --- src/layout.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/layout.c b/src/layout.c index 309ad18..ce998b1 100644 --- a/src/layout.c +++ b/src/layout.c @@ -12,6 +12,9 @@ #include "event.h" #include "util.h" +/* Shift in client split to keep clients's parent at close arrange */ +static int shiftv = 1, shifth = 1; + void layout_save_set(struct tag *t) { @@ -229,20 +232,26 @@ layout_split(struct client *c, bool vertical) if(vertical) { c->geo.w >>= 1; + c->geo.w += shiftv; geo.x = c->geo.x + c->geo.w; geo.w >>= 1; /* Remainder */ geo.w += (og.x + og.w) - (geo.x + geo.w); + + shiftv = -shiftv; } else { c->geo.h >>= 1; + c->geo.h += shifth; geo.y = c->geo.y + c->geo.h; geo.h >>= 1; /* Remainder */ geo.h += (og.y + og.h) - (geo.y + geo.h); + + shifth = -shifth; } return geo;