commit 09cd8c9a1bfc9cce984a9f34829f6e774242893c
Author: Luka Rapava <[email protected]>
Date:   Sun Apr 30 13:40:34 2023 +0400

    dwm fullgaps patch 6.4 port

diff --git a/dwm.suckless.org/patches/fullgaps/dwm-fullgaps-6.4.diff 
b/dwm.suckless.org/patches/fullgaps/dwm-fullgaps-6.4.diff
new file mode 100644
index 00000000..4ebad649
--- /dev/null
+++ b/dwm.suckless.org/patches/fullgaps/dwm-fullgaps-6.4.diff
@@ -0,0 +1,119 @@
+diff -up a/config.def.h b/config.def.h
+--- a/config.def.h     2023-04-30 12:59:59.698403950 +0400
++++ b/config.def.h     2023-04-30 13:05:21.213717136 +0400
+@@ -2,6 +2,7 @@
+ 
+ /* appearance */
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
++static const unsigned int gappx     = 5;        /* gaps between windows */
+ static const unsigned int snap      = 32;       /* snap pixel */
+ static const int showbar            = 1;        /* 0 means no bar */
+ static const int topbar             = 1;        /* 0 means bottom bar */
+@@ -85,6 +86,9 @@ static const Key keys[] = {
+       { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
+       { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
+       { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
++      { MODKEY,                       XK_minus,  setgaps,        {.i = -1 } },
++      { MODKEY,                       XK_equal,  setgaps,        {.i = +1 } },
++      { MODKEY|ShiftMask,             XK_equal,  setgaps,        {.i = 0  } },
+       TAGKEYS(                        XK_1,                      0)
+       TAGKEYS(                        XK_2,                      1)
+       TAGKEYS(                        XK_3,                      2)
+diff -up a/config.h b/config.h
+--- a/config.h 2023-04-30 13:00:14.627418493 +0400
++++ b/config.h 2023-04-30 13:05:48.671743882 +0400
+@@ -2,6 +2,7 @@
+ 
+ /* appearance */
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
++static const unsigned int gappx     = 5;        /* gaps between windows */
+ static const unsigned int snap      = 32;       /* snap pixel */
+ static const int showbar            = 1;        /* 0 means no bar */
+ static const int topbar             = 1;        /* 0 means bottom bar */
+@@ -85,6 +86,9 @@ static const Key keys[] = {
+       { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
+       { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
+       { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
++      { MODKEY,                       XK_minus,  setgaps,        {.i = -1 } },
++      { MODKEY,                       XK_equal,  setgaps,        {.i = +1 } },
++      { MODKEY|ShiftMask,             XK_equal,  setgaps,        {.i = 0  } },
+       TAGKEYS(                        XK_1,                      0)
+       TAGKEYS(                        XK_2,                      1)
+       TAGKEYS(                        XK_3,                      2)
+Only in b: drw.o
+Binary files a/dwm and b/dwm differ
+diff -up a/dwm.c b/dwm.c
+--- a/dwm.c    2023-04-30 12:59:59.699403951 +0400
++++ b/dwm.c    2023-04-30 13:03:30.534609328 +0400
+@@ -119,6 +119,7 @@ struct Monitor {
+       int by;               /* bar geometry */
+       int mx, my, mw, mh;   /* screen size */
+       int wx, wy, ww, wh;   /* window area  */
++      int gappx;            /* gaps between windows */
+       unsigned int seltags;
+       unsigned int sellt;
+       unsigned int tagset[2];
+@@ -200,6 +201,7 @@ static void sendmon(Client *c, Monitor *
+ static void setclientstate(Client *c, long state);
+ static void setfocus(Client *c);
+ static void setfullscreen(Client *c, int fullscreen);
++static void setgaps(const Arg *arg);
+ static void setlayout(const Arg *arg);
+ static void setmfact(const Arg *arg);
+ static void setup(void);
+@@ -641,6 +643,7 @@ createmon(void)
+       m->nmaster = nmaster;
+       m->showbar = showbar;
+       m->topbar = topbar;
++      m->gappx = gappx;
+       m->lt[0] = &layouts[0];
+       m->lt[1] = &layouts[1 % LENGTH(layouts)];
+       strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
+@@ -1508,6 +1511,16 @@ setfullscreen(Client *c, int fullscreen)
+ }
+ 
+ void
++setgaps(const Arg *arg)
++{
++      if ((arg->i == 0) || (selmon->gappx + arg->i < 0))
++              selmon->gappx = 0;
++      else
++              selmon->gappx += arg->i;
++      arrange(selmon);
++}
++
++void
+ setlayout(const Arg *arg)
+ {
+       if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
+@@ -1697,18 +1710,18 @@ tile(Monitor *m)
+       if (n > m->nmaster)
+               mw = m->nmaster ? m->ww * m->mfact : 0;
+       else
+-              mw = m->ww;
+-      for (i = my = ty = 0, c = nexttiled(m->clients); c; c = 
nexttiled(c->next), i++)
+-              if (i < m->nmaster) {
+-                      h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+-                      resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - 
(2*c->bw), 0);
+-                      if (my + HEIGHT(c) < m->wh)
+-                              my += HEIGHT(c);
++              mw = m->ww - m->gappx;
++      for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = 
nexttiled(c->next), i++)
++                      if (i < m->nmaster) {
++                      h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
++                      resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) 
- m->gappx, h - (2*c->bw), 0);
++                      if (my + HEIGHT(c) + m->gappx < m->wh)
++                              my += HEIGHT(c) + m->gappx;
+               } else {
+-                      h = (m->wh - ty) / (n - i);
+-                      resize(c, m->wx + mw, m->wy + ty, m->ww - mw - 
(2*c->bw), h - (2*c->bw), 0);
+-                      if (ty + HEIGHT(c) < m->wh)
+-                              ty += HEIGHT(c);
++                      h = (m->wh - ty) / (n - i) - m->gappx;
++                      resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw 
- (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
++                      if (ty + HEIGHT(c) + m->gappx < m->wh)
++                              ty += HEIGHT(c) + m->gappx;
+               }
+ }
+ 
+Common subdirectories: a/.git and b/.git
diff --git a/dwm.suckless.org/patches/fullgaps/index.md 
b/dwm.suckless.org/patches/fullgaps/index.md
index 4e226bea..676376ed 100644
--- a/dwm.suckless.org/patches/fullgaps/index.md
+++ b/dwm.suckless.org/patches/fullgaps/index.md
@@ -14,6 +14,7 @@ The configuration variable `gappx` contains the default gap 
size.
 
 Download
 --------
+* [dwm-fullgaps-6.4.diff](dwm-fullgaps-6.4.diff)
 * [dwm-fullgaps-6.2.diff](dwm-fullgaps-6.2.diff)
 * [dwm-fullgaps-20200508-7b77734.diff](dwm-fullgaps-20200508-7b77734.diff)
 
@@ -31,3 +32,4 @@ Author
 * Maciej Janicki <[email protected]>
 * David Julien <[email protected]> (20200504-b2e1dfc port)
 * Klein Bottle <[email protected]> (dwm-fullgaps-toggle...)
+* Luka Rapava <[email protected]> (6.4 port)


Reply via email to