Add dimmer shift in split size of layout split to keep parent at closing
This commit is contained in:
parent
d5aed8831b
commit
154571b65b
@ -12,6 +12,9 @@
|
|||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
/* Shift in client split to keep clients's parent at close arrange */
|
||||||
|
static int shiftv = 1, shifth = 1;
|
||||||
|
|
||||||
void
|
void
|
||||||
layout_save_set(struct tag *t)
|
layout_save_set(struct tag *t)
|
||||||
{
|
{
|
||||||
@ -229,20 +232,26 @@ layout_split(struct client *c, bool vertical)
|
|||||||
if(vertical)
|
if(vertical)
|
||||||
{
|
{
|
||||||
c->geo.w >>= 1;
|
c->geo.w >>= 1;
|
||||||
|
c->geo.w += shiftv;
|
||||||
geo.x = c->geo.x + c->geo.w;
|
geo.x = c->geo.x + c->geo.w;
|
||||||
geo.w >>= 1;
|
geo.w >>= 1;
|
||||||
|
|
||||||
/* Remainder */
|
/* Remainder */
|
||||||
geo.w += (og.x + og.w) - (geo.x + geo.w);
|
geo.w += (og.x + og.w) - (geo.x + geo.w);
|
||||||
|
|
||||||
|
shiftv = -shiftv;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
c->geo.h >>= 1;
|
c->geo.h >>= 1;
|
||||||
|
c->geo.h += shifth;
|
||||||
geo.y = c->geo.y + c->geo.h;
|
geo.y = c->geo.y + c->geo.h;
|
||||||
geo.h >>= 1;
|
geo.h >>= 1;
|
||||||
|
|
||||||
/* Remainder */
|
/* Remainder */
|
||||||
geo.h += (og.y + og.h) - (geo.y + geo.h);
|
geo.h += (og.y + og.h) - (geo.y + geo.h);
|
||||||
|
|
||||||
|
shifth = -shifth;
|
||||||
}
|
}
|
||||||
|
|
||||||
return geo;
|
return geo;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user