tRemove gaps patch - dwm - [fork] customized build of dwm, the dynamic window manager
 (HTM) git clone git://src.adamsgaard.dk/dwm
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit bce1f84f9bfbf4654fd5cced3a0269c89590319d
 (DIR) parent 7c099bd74e3f1691da859a1277a501ebe4d53fd6
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Sat, 23 May 2020 20:44:19 +0200
       
       Remove gaps patch
       
       Diffstat:
         M config.h                            |       5 -----
         M dwm.c                               |      31 ++++++++++---------------------
       
       2 files changed, 10 insertions(+), 26 deletions(-)
       ---
 (DIR) diff --git a/config.h b/config.h
       t@@ -2,7 +2,6 @@
        
        /* appearance */
        static const unsigned int borderpx  = 0;        /* border pixel of windows */
       -static const unsigned int gappx     = 0;        /* 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 */
       t@@ -206,10 +205,6 @@ static 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|ShiftMask,             XK_equal,  setgaps,        {.i = +1 } },
       -        { MODKEY|MODALTKEY,             XK_equal,  setgaps,        {.i = 0  } },
       -        { MODKEY,                       XK_equal,  setgaps,        {.i = gappx } },
                TAGKEYS(                        XK_1,                      0)
                TAGKEYS(                        XK_2,                      1)
                TAGKEYS(                        XK_3,                      2)
 (DIR) diff --git a/dwm.c b/dwm.c
       t@@ -123,7 +123,6 @@ 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];
       t@@ -206,7 +205,6 @@ static void sendmon(Client *c, Monitor *m);
        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);
       t@@ -663,7 +661,6 @@ 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);
       t@@ -1562,16 +1559,6 @@ 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])
       t@@ -1757,16 +1744,18 @@ tile(Monitor *m)
                if (n > m->nmaster)
                        mw = m->nmaster ? m->ww * m->mfact : 0;
                else
       -                mw = m->ww - m->gappx;
       -        for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
       +                mw = m->ww;
       +        for (i = 0, 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) - m->gappx;
       -                        resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
       -                        my += HEIGHT(c) + m->gappx;
       +                        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);
                        } else {
       -                        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);
       -                        ty += HEIGHT(c) + m->gappx;
       +                        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);
                        }
        }