commit 99413271210834313b11d6fa4527017c3f15d2b7
parent 6f8f9e7da499f45675ae3021f50220b0cd2c433e
Author: Aaron Duxler <aaron.duxler@gmail.com>
Date: Tue, 28 May 2019 14:10:11 +0200
[dwm] [patch] ru_gaps centered master, removed double gaps between centered master and
clients left and right as well as double gaps when nmaster is 0
Diffstat:
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_centeredmaster-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_centeredmaster-6.2.diff
@@ -11,9 +11,9 @@ diff -up a/config.def.h b/config.def.h
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
diff -up a/dwm.c b/dwm.c
---- a/dwm.c 2019-05-12 13:27:12.179914831 +0200
-+++ b/dwm.c 2019-05-12 14:52:16.943332307 +0200
-@@ -235,6 +235,8 @@ static int xerror(Display *dpy, XErrorEv
+--- a/dwm.c 2019-05-28 13:43:00.326646120 +0200
++++ b/dwm.c 2019-05-28 13:56:27.203297444 +0200
+@@ -233,6 +233,8 @@ static int xerror(Display *dpy, XErrorEv
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
@@ -22,7 +22,7 @@ diff -up a/dwm.c b/dwm.c
/* variables */
static const char broken[] = "broken";
-@@ -2172,3 +2174,116 @@ main(int argc, char *argv[])
+@@ -2147,3 +2149,127 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}
@@ -68,14 +68,25 @@ diff -up a/dwm.c b/dwm.c
+ /* nmaster clients are stacked vertically, in the center
+ * of the screen */
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
-+ resize(c, m->wx + mx + m->gappx, m->wy + my + m->gappx, mw - 2*(c->bw + m->gappx),
++ if(m->nmaster >= n)
++ resize(c, m->wx + mx + m->gappx, m->wy + my + m->gappx, mw - 2*(c->bw + m->gappx),
++ h - (2*c->bw) - m->gappx, 0);
++ else if(m->nmaster + 1 < n)
++ resize(c, m->wx + mx, m->wy + my + m->gappx, mw - 2*(c->bw),
++ h - (2*c->bw) - m->gappx, 0);
++ else
++ resize(c, m->wx + mx + m->gappx, m->wy + my + m->gappx, mw - 2*(c->bw) - m->gappx,
+ h - (2*c->bw) - m->gappx, 0);
+ my += HEIGHT(c) + m->gappx;
+ } else {
+ /* stack clients are stacked vertically */
+ if ((i - m->nmaster) % 2 ) {
+ h = (m->wh - ety) / ( (1 + n - i) / 2) - m->gappx;
-+ resize(c, m->wx + m->gappx, m->wy + ety + m->gappx, tw - 2*(c->bw + m->gappx),
++ if(m->nmaster == 0)
++ resize(c, m->wx + m->gappx, m->wy + ety + m->gappx, tw - 2*(c->bw) - m->gappx,
++ h - (2*c->bw) - m->gappx, 0);
++ else
++ resize(c, m->wx + m->gappx, m->wy + ety + m->gappx, tw - 2*(c->bw + m->gappx),
+ h - (2*c->bw) - m->gappx, 0);
+ ety += HEIGHT(c) + m->gappx;
+ } else {