From b27996517aa7d6da7407f3342d51f8eeace22b32 Mon Sep 17 00:00:00 2001 From: ktyl Date: Tue, 21 Jan 2025 21:24:46 +0000 Subject: [PATCH] feat: nomonocleborders --- dwm.c | 12 ++++++++++++ patches/other.txt | 1 + 2 files changed, 13 insertions(+) create mode 100644 patches/other.txt diff --git a/dwm.c b/dwm.c index 4d88b72..8bd5a6c 100644 --- a/dwm.c +++ b/dwm.c @@ -327,6 +327,12 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) int baseismin; Monitor *m = c->mon; + // return 1 if layout is monocle + if (&monocle == c->mon->lt[c->mon->sellt]->arrange) + { + return 1; + } + /* set minimum possible */ *w = MAX(1, *w); *h = MAX(1, *h); @@ -1313,6 +1319,12 @@ resizeclient(Client *c, int x, int y, int w, int h) c->oldw = c->w; c->w = wc.width = w; c->oldh = c->h; c->h = wc.height = h; wc.border_width = c->bw; + if ((&monocle == c->mon->lt[c->mon->sellt]->arrange) && (!c->isfloating)) + { + wc.border_width = 0; + c->w = wc.width += c->bw * 2; + c->h = wc.height += c->bw * 2; + } XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); XSync(dpy, False); diff --git a/patches/other.txt b/patches/other.txt new file mode 100644 index 0000000..5d27f11 --- /dev/null +++ b/patches/other.txt @@ -0,0 +1 @@ +nomonocleborders https://gist.github.com/SebastianJarsve/497b2014774c849df0132d7118cbab65