2019-09-14 23:28:04 +02:00
|
|
|
void
|
|
|
|
setborderpx(const Arg *arg)
|
|
|
|
{
|
|
|
|
Client *c;
|
2022-03-30 14:20:27 +02:00
|
|
|
Monitor *m = selmon;
|
|
|
|
#if BAR_BORDER_PATCH
|
|
|
|
Bar *bar;
|
|
|
|
#endif // BAR_BORDER_PATCH
|
|
|
|
int prev_borderpx = m->borderpx;
|
|
|
|
m->borderpx = arg->i
|
|
|
|
? MAX(m->borderpx + arg->i, 0)
|
|
|
|
: m->borderpx == borderpx
|
|
|
|
? 0
|
|
|
|
: borderpx;
|
|
|
|
int delta = 2 * (m->borderpx - prev_borderpx);
|
2019-09-14 23:28:04 +02:00
|
|
|
|
2020-10-04 21:02:56 +02:00
|
|
|
#if BAR_BORDER_PATCH
|
2022-03-30 14:20:27 +02:00
|
|
|
for (bar = m->bar; bar; bar = bar->next) {
|
|
|
|
bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx;
|
|
|
|
bar->borderpx = m->borderpx;
|
2020-10-04 21:02:56 +02:00
|
|
|
}
|
2022-03-30 14:20:27 +02:00
|
|
|
updatebarpos(m);
|
|
|
|
for (bar = m->bar; bar; bar = bar->next)
|
2020-10-04 21:02:56 +02:00
|
|
|
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
|
|
|
|
#endif // BAR_BORDER_PATCH
|
|
|
|
|
2022-03-30 14:20:27 +02:00
|
|
|
for (c = m->clients; c; c = c->next) {
|
|
|
|
c->bw = m->borderpx;
|
|
|
|
#if !FAKEFULLSCREEN_PATCH
|
|
|
|
#if FAKEFULLSCREEN_CLIENT_PATCH
|
|
|
|
if (c->isfullscreen && !c->fakefullscreen)
|
|
|
|
continue;
|
|
|
|
#else
|
|
|
|
if (c->isfullscreen)
|
|
|
|
continue;
|
|
|
|
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
|
|
|
#endif // FAKEFULLSCREEN_PATCH
|
|
|
|
#if BAR_WINTITLEACTIONS_PATCH
|
|
|
|
if (HIDDEN(c))
|
|
|
|
continue;
|
|
|
|
#endif // BAR_WINTITLEACTIONS_PATCH
|
2022-06-20 14:00:09 +02:00
|
|
|
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
|
2022-03-30 14:20:27 +02:00
|
|
|
if ((c->tags & SPTAGMASK) && !ISVISIBLE(c))
|
|
|
|
continue;
|
|
|
|
#endif // SCRATCHPADS_PATCH
|
|
|
|
#if SCRATCHPAD_ALT_1_PATCH
|
|
|
|
if ((c->tags & SCRATCHPAD_MASK))
|
|
|
|
continue;
|
|
|
|
#endif // SCRATCHPAD_ALT_1_PATCH
|
|
|
|
if (!c->isfloating && m->lt[m->sellt]->arrange)
|
|
|
|
continue;
|
2020-10-04 21:02:56 +02:00
|
|
|
|
2022-03-30 14:20:27 +02:00
|
|
|
resizeclient(c, c->x, c->y, c->w - delta, c->h - delta);
|
2020-05-13 13:17:12 +02:00
|
|
|
}
|
2022-03-30 14:20:27 +02:00
|
|
|
arrange(m);
|
2020-09-21 01:08:19 +02:00
|
|
|
}
|