summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2022-02-11 11:43:06 +0100
committerbakkeby <[email protected]>2022-02-11 11:43:36 +0100
commit282dc2ad22fd9483a4349064ce7e7e5e4476ef18 (patch)
tree554e75d43a041cd8a0c2c643b5ae0239a295f201
parent90e4dfc0cf76a3126981c443dd3013a7ccf049bc (diff)
downloaddwm-flexipatch-282dc2ad22fd9483a4349064ce7e7e5e4476ef18.tar.gz
dwm-flexipatch-282dc2ad22fd9483a4349064ce7e7e5e4476ef18.zip
barpadding: adding vanitygaps variant
-rw-r--r--dwm.c21
-rw-r--r--patch/vanitygaps.c7
-rw-r--r--patches.def.h9
3 files changed, 17 insertions, 20 deletions
diff --git a/dwm.c b/dwm.c
index 95d7cf8..37c265f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -4343,25 +4343,22 @@ updatebarpos(Monitor *m)
m->ww = m->mw;
m->wh = m->mh;
Bar *bar;
- #if BAR_GAPS_PADDING_PATCH && VANITYGAPS_PATCH
int y_pad = 0;
int x_pad = 0;
-
+ #if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
- if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag]) {
+ if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag])
#else
- if (enablegaps) {
+ if (enablegaps)
#endif // PERTAG_VANITYGAPS_PATCH
- y_pad = gappov;
- x_pad = gappoh;
+ {
+ y_pad = gappoh;
+ x_pad = gappov;
}
#elif BAR_PADDING_PATCH
- int y_pad = vertpad;
- int x_pad = sidepad;
- #else
- int y_pad = 0;
- int x_pad = 0;
- #endif // BAR_PADDING_PATCH
+ y_pad = vertpad;
+ x_pad = sidepad;
+ #endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH
#if INSETS_PATCH
// Custom insets
diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c
index 880bf4a..d322ded 100644
--- a/patch/vanitygaps.c
+++ b/patch/vanitygaps.c
@@ -87,16 +87,15 @@ togglegaps(const Arg *arg)
enablegaps = !enablegaps;
#endif // PERTAG_VANITYGAPS_PATCH
- #if BAR_GAPS_PADDING_PATCH
+ #if BAR_PADDING_VANITYGAPS_PATCH
updatebarpos(selmon);
- Bar *bar;
- for (bar = selmon->bar; bar; bar = bar->next)
+ for (Bar *bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
#if BAR_SYSTRAY_PATCH
drawbarwin(systray->bar);
#endif // BAR_SYSTRAY_PATCH
- #endif // BAR_GAPS_PADDING_PATCH
+ #endif // BAR_PADDING_VANITYGAPS_PATCH
arrange(NULL);
}
diff --git a/patches.def.h b/patches.def.h
index 3d59e2e..dbd133d 100644
--- a/patches.def.h
+++ b/patches.def.h
@@ -347,11 +347,12 @@
*/
#define BAR_PADDING_PATCH 0
-/* Same as barpadding patch but specifically written for the vanitygaps patch. It adds the same
- * outer horizontal and vertical padding as vanity gaps. Moreover, the padding is toggled whenever
- * vanitygaps are toggled.
+/* Same as barpadding patch but specifically tailored for the vanitygaps patch in that the outer
+ * bar padding is derived from the vanitygaps settings. In addition to this the bar padding is
+ * toggled in unison when vanitygaps are toggled. Increasing or decreasing gaps during runtime
+ * will not affect the bar padding.
*/
-#define BAR_GAPS_PADDING_PATCH 0
+#define BAR_PADDING_VANITYGAPS_PATCH 0
/* This patch adds simple markup for status messages using pango markup.
* This depends on the pango library v1.44 or greater.