[wiki] [sites] [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 || Aaron Duxler

From: <git_AT_suckless.org>
Date: Tue, 28 May 2019 14:07:54 +0200

commit 99413271210834313b11d6fa4527017c3f15d2b7
Author: Aaron Duxler <aaron.duxler_AT_gmail.com>
Date: Tue May 28 14:10:11 2019 +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

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
index 4f2d23df..4e119deb 100644
--- 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
_AT_@ -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
-_AT_@ -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
+_AT_@ -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);
_AT_@ -22,7 +22,7 @@ diff -up a/dwm.c b/dwm.c
  
  /* variables */
  static const char broken[] = "broken";
-_AT_@ -2172,3 +2174,116 @@ main(int argc, char *argv[])
+_AT_@ -2147,3 +2149,127 @@ main(int argc, char *argv[])
          XCloseDisplay(dpy);
          return EXIT_SUCCESS;
  }
_AT_@ -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 {
Received on Tue May 28 2019 - 14:07:54 CEST

This archive was generated by hypermail 2.3.0 : Tue May 28 2019 - 14:12:28 CEST