From e3e9c6aaa9ff6dfb622becc5eeb89d9cbeb8c61e Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Mon, 15 Mar 2021 08:01:55 +0900 Subject: [PATCH] Remove tiling layout The tiling layout is not used. This commit removes the tiling layout and all associated functions and fields. --- config.def.h | 10 ------- dwm.c | 80 ---------------------------------------------------- 2 files changed, 90 deletions(-) diff --git a/config.def.h b/config.def.h index 3be605b..aa0460a 100755 --- a/config.def.h +++ b/config.def.h @@ -24,7 +24,6 @@ static const struct rule rules[] = { }; /* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */ @@ -38,7 +37,6 @@ static const struct layout layouts[] = { /* symbol arrange function */ { "|||", bookshelf }, /* first entry is default */ { "===", bookstack }, - { "[]=", tile }, { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle } }; @@ -82,16 +80,8 @@ static struct key keys[] = { { MODKEY, XK_a, focusstack, {.i = -1 } }, /* focus on right/below window (bookshelf/bookstack) */ { MODKEY, XK_d, focusstack, {.i = +1 } }, - /* increase master size */ - { MODKEY, XK_w, incnmaster, {.i = +1 } }, - /* decrease master size */ - { MODKEY, XK_s, incnmaster, {.i = -1 } }, /* move window to master */ { MODKEY, XK_Return, zoom, {0} }, -#ifndef M10K - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, -#endif /* ! M10K */ /* move to previous tag */ { MODKEY, XK_Tab, view, {0} }, /* kill focused window */ diff --git a/dwm.c b/dwm.c index f3abd9e..856941f 100755 --- a/dwm.c +++ b/dwm.c @@ -215,8 +215,6 @@ struct layout { struct monitor { char ltsymbol[16]; - float mfact; - int nmaster; int num; int by; struct rect geom; @@ -291,7 +289,6 @@ static long getstate(Window w); static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(struct client *c, Bool focused); static void grabkeys(void); -static void incnmaster(const union arg *arg); static void initfont(const char *fontstr); static void keypress(XEvent *e); static void killclient(const union arg *arg); @@ -324,9 +321,6 @@ static void setclientstate(struct client *c, long state); static void setfocus(struct client *c); static void setfullscreen(struct client *c, Bool fullscreen); static void setlayout(const union arg *arg); -#ifndef M10K -static void setmfact(const union arg *arg); -#endif /* ! M10K */ static void setup(void); static void showhide(struct client *c); static void sigchld(int unused); @@ -334,7 +328,6 @@ static void spawn(const union arg *arg); static void tag(const union arg *arg); static void tagmon(const union arg *arg); static int textnw(const char *text, unsigned int len); -static void tile(struct monitor *monitor); #ifndef M10K static void togglebar(const union arg *arg); #endif /* ! M10K */ @@ -1010,8 +1003,6 @@ struct monitor *createmon(void) m->tagset[0] = 1; m->tagset[1] = 1; - m->mfact = mfact; - m->nmaster = nmaster; m->topbar = topbar; m->lt[0] = &layouts[0]; m->lt[1] = &layouts[1 % LENGTH(layouts)]; @@ -1556,14 +1547,6 @@ void grabkeys(void) return; } -void incnmaster(const union arg *arg) -{ - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); - - return; -} - void initfont(const char *fontstr) { PangoFontMap *fontmap; @@ -2377,29 +2360,6 @@ void setlayout(const union arg *arg) return; } -#ifndef M10K -/* arg > 1.0 will set mfact absolutly */ -void setmfact(const union arg *arg) -{ - float f; - - if(!arg || !selmon->lt[selmon->sellt]->arrange) { - return; - } - - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - - if(f < 0.1 || f > 0.9) { - return; - } - - selmon->mfact = f; - arrange(selmon); - - return; -} -#endif /* ! M10K */ - void setup(void) { XSetWindowAttributes wa; @@ -2565,46 +2525,6 @@ int textnw(const char *text, unsigned int len) return(r.width / PANGO_SCALE); } -void tile(struct monitor *m) -{ - unsigned int i, n, h, mw, my, ty; - struct client *c; - - for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - - if(n == 0) { - return; - } - - if(n > m->nmaster) { - mw = m->nmaster ? m->win_geom.w * m->mfact : 0; - } else { - mw = m->win_geom.w; - } - - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - int border; - - border = 2 * c->border.w; - - if(i < m->nmaster) { - h = (m->win_geom.h - my) / (MIN(n, m->nmaster) - i); - resize(c, m->win_geom.x, m->win_geom.y + my, - mw - border, h - border, False); - - my += client_get_height(c); - } else { - h = (m->win_geom.h - ty) / (n - i); - resize(c, m->win_geom.x + mw, m->win_geom.y + ty, - m->win_geom.w - mw - border, h - border, False); - - ty += client_get_height(c); - } - } - - return; -} - static int count_tiled_clients(struct monitor *mon) { struct client *tiled; -- 2.47.3