[wiki] [sites] [dwm][setborderpx] allow setting floating borders to 0 regardless of stepsize || Aaron Duxler

From: <git_AT_suckless.org>
Date: Thu, 14 May 2020 00:24:40 +0200

commit 804c727fbf96b617701c6ef86f6434b4c178bd24
Author: Aaron Duxler <aaron_AT_duxler.xyz>
Date: Thu May 14 00:24:28 2020 +0200

    [dwm][setborderpx] allow setting floating borders to 0 regardless of stepsize

diff --git a/dwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff b/dwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff
index 9ba2ae0a..020e75bf 100644
--- a/dwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff
+++ b/dwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff
_AT_@ -1,6 +1,6 @@
 diff -up a/config.def.h b/config.def.h
 --- a/config.def.h 2020-05-12 02:17:20.070933833 +0200
-+++ b/config.def.h 2020-05-13 03:22:42.208588454 +0200
++++ b/config.def.h 2020-05-13 03:27:51.018695798 +0200
 _AT_@ -84,6 +84,9 @@ static Key keys[] = {
          { MODKEY, XK_period, focusmon, {.i = +1 } },
          { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
_AT_@ -13,7 +13,7 @@ diff -up a/config.def.h b/config.def.h
          TAGKEYS( XK_3, 2)
 diff -up a/dwm.c b/dwm.c
 --- a/dwm.c 2020-05-12 02:17:20.070933833 +0200
-+++ b/dwm.c 2020-05-13 03:26:48.248734286 +0200
++++ b/dwm.c 2020-05-14 00:17:35.047919771 +0200
 _AT_@ -119,6 +119,7 @@ struct Monitor {
          int by; /* bar geometry */
          int mx, my, mw, mh; /* screen size */
_AT_@ -47,7 +47,7 @@ diff -up a/dwm.c b/dwm.c
  
          wc.border_width = c->bw;
          XConfigureWindow(dpy, w, CWBorderWidth, &wc);
-_AT_@ -1424,6 +1427,41 @@ sendmon(Client *c, Monitor *m)
+_AT_@ -1424,6 +1427,40 @@ sendmon(Client *c, Monitor *m)
  }
  
  void
_AT_@ -68,18 +68,17 @@ diff -up a/dwm.c b/dwm.c
 + if (c->bw + arg->i < 0)
 + c->bw = selmon->borderpx = 0;
 + else
-+ {
 + c->bw = selmon->borderpx;
-+
-+ if (c->isfloating || !selmon->lt[selmon->sellt]->arrange)
-+ {
-+ if (arg->i != 0)
-+ resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0);
-+ else if (prev_borderpx > borderpx)
-+ resize(c, c->x + prev_borderpx - borderpx, c->y + prev_borderpx - borderpx, c->w, c->h, 0);
-+ else if (prev_borderpx < borderpx)
-+ resize(c, c->x, c->y, c->w-2*(borderpx - prev_borderpx), c->h-2*(borderpx - prev_borderpx), 0);
-+ }
++ if (c->isfloating || !selmon->lt[selmon->sellt]->arrange)
++ {
++ if (arg->i != 0 && prev_borderpx + arg->i >= 0)
++ resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0);
++ else if (arg->i != 0)
++ resizeclient(c, c->x, c->y, c->w, c->h);
++ else if (prev_borderpx > borderpx)
++ resize(c, c->x + prev_borderpx - borderpx, c->y + prev_borderpx - borderpx, c->w, c->h, 0);
++ else if (prev_borderpx < borderpx)
++ resize(c, c->x, c->y, c->w-2*(borderpx - prev_borderpx), c->h-2*(borderpx - prev_borderpx), 0);
 + }
 + }
 + arrange(selmon);
diff --git a/dwm.suckless.org/patches/setborderpx/index.md b/dwm.suckless.org/patches/setborderpx/index.md
index a0b18b8a..fe500a39 100644
--- a/dwm.suckless.org/patches/setborderpx/index.md
+++ b/dwm.suckless.org/patches/setborderpx/index.md
_AT_@ -21,7 +21,7 @@ when increasing or decreasing border pixels.
 
 Download
 --------
-* [dwm-setborderpx-6.2.diff](dwm-setborderpx-6.2.diff) - 12-05-2020
+* [dwm-setborderpx-6.2.diff](dwm-setborderpx-6.2.diff) - 14-05-2020
 
 Author
 ------
Received on Thu May 14 2020 - 00:24:40 CEST

This archive was generated by hypermail 2.3.0 : Thu May 14 2020 - 00:24:48 CEST