aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-07-20 11:59:54 +0300
committereug-vs <eug-vs@keemail.me>2021-07-20 11:59:54 +0300
commit9b6b9932e3e160ebba78803e88faf3abc75e0f38 (patch)
tree70964671f5a9125ff4fd91db8cc1779197fc0970
parenta9d33a53f2626a824a80757cb6214f735a1aa274 (diff)
downloaddwm-9b6b9932e3e160ebba78803e88faf3abc75e0f38.tar.gz
Revert "feat: add gaps"
This reverts commit 7985c39e7f767fbdcc835c13c24455c96ba8e8d6.
-rw-r--r--config.def.h4
-rw-r--r--dwm.110
-rw-r--r--dwm.c33
3 files changed, 10 insertions, 37 deletions
diff --git a/config.def.h b/config.def.h
index 90e4733..9a29547 100644
--- a/config.def.h
+++ b/config.def.h
@@ -2,7 +2,6 @@
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
-static const unsigned int gappx = 48; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
@@ -100,9 +99,6 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_h, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_l, tagmon, {.i = +1 } },
{ MODKEY, XK_r, resizemouse, {0} },
- { 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 --git a/dwm.1 b/dwm.1
index 85b3438..ddc8321 100644
--- a/dwm.1
+++ b/dwm.1
@@ -140,16 +140,6 @@ View all windows with any tag.
.B Mod1\-Control\-[1..n]
Add/remove all windows with nth tag to/from the view.
.TP
-.B Mod1\--
-Decrease the gaps around windows.
-.TP
-.B Mod1\-=
-Increase the gaps around windows.
-.TP
-.B Mod1\-Shift-=
-Reset the gaps around windows to
-.BR 0 .
-.TP
.B Mod1\-Shift\-q
Quit dwm.
.SS Mouse commands
diff --git a/dwm.c b/dwm.c
index 32632b6..fc2ab10 100644
--- a/dwm.c
+++ b/dwm.c
@@ -141,7 +141,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];
@@ -237,7 +236,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);
@@ -789,7 +787,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);
@@ -1749,16 +1746,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])
@@ -1953,18 +1940,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 = 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);
- if (my + HEIGHT(c) + m->gappx < m->wh)
- 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);
- if (ty + HEIGHT(c) + m->gappx < m->wh)
- 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);
}
}