summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-05-13 13:17:12 +0200
committerbakkeby <[email protected]>2020-05-13 13:17:12 +0200
commit5cfaf8357b75c5d4a96c1c3fe2644271c13e0c61 (patch)
treeb1582682f6919e5639132652ad0a3b26f8751270
parent1c6412802edea20a71da430c6b195bdfd14ca267 (diff)
downloaddwm-flexipatch-5cfaf8357b75c5d4a96c1c3fe2644271c13e0c61.tar.gz
dwm-flexipatch-5cfaf8357b75c5d4a96c1c3fe2644271c13e0c61.zip
[dwm][setborderpx] allow borderpixel changes in floating layout and for floating clients
-rw-r--r--patch/setborderpx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/patch/setborderpx.c b/patch/setborderpx.c
index 76bf726..f00f84e 100644
--- a/patch/setborderpx.c
+++ b/patch/setborderpx.c
@@ -2,6 +2,7 @@ void
setborderpx(const Arg *arg)
{
Client *c;
+ int prev_borderpx = selmon->borderpx;
if (arg->i == 0)
mons->borderpx = borderpx;
@@ -11,10 +12,21 @@ setborderpx(const Arg *arg)
mons->borderpx += arg->i;
for (c = mons->clients; c; c = c->next)
+ {
if (c->bw + arg->i < 0)
c->bw = mons->borderpx = 0;
else
c->bw = mons->borderpx;
+ if (c->isfloating || !selmon->lt[selmon->sellt]->arrange)
+ {
+ if (arg->i != 0 && prev_borderpx + arg->i >= 0)
+ resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0);
+ else if (arg->i == 0 && prev_borderpx > borderpx)
+ resize(c, c->x + prev_borderpx - borderpx, c->y + prev_borderpx - borderpx, c->w, c->h, 0);
+ else if (arg->i == 0 && prev_borderpx < borderpx)
+ resize(c, c->x, c->y, c->w-2*(borderpx - prev_borderpx), c->h-2*(borderpx - prev_borderpx), 0);
+ }
+ }
arrange(selmon);
} \ No newline at end of file