[wiki] [sites] [dwm][patch] code cleanup and bug fix. All clients in gaplessgrid should be the same size even after increasing gaps || Aaron Duxler
commit 8b4111a486e25e3c50846ec7bcebf520515b5116
Author: Aaron Duxler <aaron.duxler_AT_gmail.com>
Date: Tue Jun 25 02:40:56 2019 +0200
[dwm][patch] code cleanup and bug fix. All clients in gaplessgrid should be the same size even after increasing gaps
diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff
index 2fe60ab2..80fda469 100644
--- a/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff
+++ b/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff
_AT_@ -14,8 +14,8 @@ diff -upN a/config.def.h b/config.def.h
{ "[M]", monocle },
diff -upN a/gaplessgrid.c b/gaplessgrid.c
--- a/gaplessgrid.c 1970-01-01 01:00:00.000000000 +0100
-+++ b/gaplessgrid.c 2019-05-29 00:26:33.779968246 +0200
-_AT_@ -0,0 +1,47 @@
++++ b/gaplessgrid.c 2019-06-25 00:26:33.779968246 +0200
+_AT_@ -0,0 +1,40 @@
+void
+gaplessgrid(Monitor *m) {
+ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch;
_AT_@ -45,17 +45,10 @@ diff -upN a/gaplessgrid.c b/gaplessgrid.c
+ for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) {
+ if(i/rows + 1 > cols - n%cols)
+ rows = n/cols + 1;
-+ ch = rows ? m->wh / rows : m->wh;
-+ cx = m->wx + cn*cw;
-+ cy = m->wy + rn*ch;
-+ if(cn+1 == cols && rn+1 == rows)
-+ resize(c, cx + m->gappx, cy + m->gappx, cw - 2 * (c->bw + m->gappx), ch - 2 * (c->bw + m->gappx), False);
-+ else if(cn+1 == cols)
-+ resize(c, cx + m->gappx, cy + m->gappx, cw - 2 * (c->bw + m->gappx), ch - 2 * (c->bw) - m->gappx, False);
-+ else if(rn+1 == rows)
-+ resize(c, cx + m->gappx, cy + m->gappx, cw - 2 * (c->bw) - m->gappx, ch - 2 * (c->bw + m->gappx), False);
-+ else
-+ resize(c, cx + m->gappx, cy + m->gappx, cw - 2 * (c->bw) - m->gappx, ch - 2 * (c->bw) - m->gappx, False);
++ ch = rows ? (m->wh-m->gappx) / rows : m->wh;
++ cx = m->wx + m->gappx + cn*cw;
++ cy = m->wy + m->gappx + rn*ch;
++ resize(c, cx - cn*m->gappx/cols, cy, cw - 2 * (c->bw) - m->gappx - m->gappx/cols, ch - 2 * c->bw - m->gappx, False);
+ rn++;
+ if(rn >= rows) {
+ rn = 0;
diff --git a/dwm.suckless.org/patches/ru_gaps/index.md b/dwm.suckless.org/patches/ru_gaps/index.md
index 22af068c..768a2b75 100644
--- a/dwm.suckless.org/patches/ru_gaps/index.md
+++ b/dwm.suckless.org/patches/ru_gaps/index.md
_AT_@ -27,7 +27,7 @@ A copy of the [fibonacci](../fibonacci/), but with resizeable gaps.
* [dwm-ru\_fibonacci-6.2.diff](dwm-ru_fibonacci-6.2.diff)
A copy of the [gaplessgrid](../gaplessgrid/), but with resizeable gaps.
-* [dwm-ru\_gaplessgrid-6.2.diff](dwm-ru_gaplessgrid-6.2.diff)
+* [dwm-ru\_gaplessgrid-6.2.diff](dwm-ru_gaplessgrid-6.2.diff) - 25-06-2019
A copy of the [bottomstack](../bottomstack/), but with resizeable gaps.
* [dwm-ru\_bottomstack-6.2.diff](dwm-ru_bottomstack-6.2.diff)
Received on Tue Jun 25 2019 - 02:38:07 CEST
This archive was generated by hypermail 2.3.0
: Tue Jun 25 2019 - 02:48:29 CEST