2019-09-14 21:28:04 +00:00
|
|
|
void
|
|
|
|
setborderpx(const Arg *arg)
|
|
|
|
{
|
|
|
|
Client *c;
|
2020-05-13 11:17:12 +00:00
|
|
|
int prev_borderpx = selmon->borderpx;
|
2019-09-14 21:28:04 +00:00
|
|
|
|
|
|
|
if (arg->i == 0)
|
2020-05-13 11:25:06 +00:00
|
|
|
selmon->borderpx = borderpx;
|
|
|
|
else if (selmon->borderpx + arg->i < 0)
|
|
|
|
selmon->borderpx = 0;
|
2019-09-14 21:28:04 +00:00
|
|
|
else
|
2020-05-13 11:25:06 +00:00
|
|
|
selmon->borderpx += arg->i;
|
2019-09-14 21:28:04 +00:00
|
|
|
|
2020-05-13 11:25:06 +00:00
|
|
|
for (c = selmon->clients; c; c = c->next)
|
2020-05-13 11:17:12 +00:00
|
|
|
{
|
2019-09-14 21:28:04 +00:00
|
|
|
if (c->bw + arg->i < 0)
|
2020-05-13 11:25:06 +00:00
|
|
|
c->bw = selmon->borderpx = 0;
|
2019-09-14 21:28:04 +00:00
|
|
|
else
|
2020-05-13 11:25:06 +00:00
|
|
|
c->bw = selmon->borderpx;
|
|
|
|
|
2020-05-20 13:11:33 +00:00
|
|
|
if (c->isfloating || !selmon->lt[selmon->sellt]->arrange)
|
|
|
|
{
|
|
|
|
if (arg->i != 0)
|
|
|
|
resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0);
|
|
|
|
else if (prev_borderpx > borderpx)
|
|
|
|
resize(c, c->x, c->y, c->w + 2*(prev_borderpx - borderpx), c->h + 2*(prev_borderpx - borderpx), 0);
|
|
|
|
else if (prev_borderpx < borderpx)
|
|
|
|
resize(c, c->x, c->y, c->w - 2*(borderpx - prev_borderpx), c->h - 2*(borderpx - prev_borderpx), 0);
|
2020-05-13 11:17:12 +00:00
|
|
|
}
|
|
|
|
}
|
2019-09-14 21:28:04 +00:00
|
|
|
arrange(selmon);
|
|
|
|
}
|