summaryrefslogtreecommitdiff
path: root/dwm/patch/setborderpx.c
diff options
context:
space:
mode:
authorcoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
committercoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
commit8cbadb61604667b407b53ee1258433994fa4765a (patch)
tree97765fb29418fd6278fcb4cbb9760893afaf7a58 /dwm/patch/setborderpx.c
Diffstat (limited to 'dwm/patch/setborderpx.c')
-rwxr-xr-xdwm/patch/setborderpx.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/dwm/patch/setborderpx.c b/dwm/patch/setborderpx.c
new file mode 100755
index 0000000..250a939
--- /dev/null
+++ b/dwm/patch/setborderpx.c
@@ -0,0 +1,58 @@
+void
+setborderpx(const Arg *arg)
+{
+ Client *c;
+ 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);
+
+ #if BAR_BORDER_PATCH
+ if (!barborderpx) {
+ for (bar = m->bar; bar; bar = bar->next) {
+ bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx;
+ bar->borderpx = m->borderpx;
+ }
+ updatebarpos(m);
+ for (bar = m->bar; bar; bar = bar->next)
+ XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
+ }
+ #endif // BAR_BORDER_PATCH
+
+ 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
+ #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
+ 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;
+
+ resizeclient(c, c->x, c->y, c->w - delta, c->h - delta);
+ }
+ arrange(m);
+}