Change name of variables, add for gaps

This commit is contained in:
speediegq 2022-09-14 18:01:06 +02:00
parent d93d49c5e0
commit 3572abc551
5 changed files with 19 additions and 12 deletions

View file

@ -96,8 +96,9 @@
- speedwm.hidefloating: 0 - speedwm.hidefloating: 0
- speedwm.leftlayout: 1 - speedwm.leftlayout: 1
- speedwm.fadeinactive: 1 - speedwm.fadeinactive: 1
- speedwm.defaultlayout: 1 - speedwm.resetlayout: 1
- speedwm.defaultmfact: 1 - speedwm.resetmfact: 1
- speedwm.resetgaps: 1
- speedwm.wmclass: 1 - speedwm.wmclass: 1
- speedwm.stairpx: 20 - speedwm.stairpx: 20
- speedwm.stairdirection: 1 - speedwm.stairdirection: 1

View file

@ -71,7 +71,7 @@ static Signal signals[] = {
{ 23, togglebar, {0} }, { 23, togglebar, {0} },
{ 24, togglefullscr, {0} }, { 24, togglefullscr, {0} },
{ 25, self_restart, {0} }, { 25, self_restart, {0} },
{ 28, resetlayout, {0} }, { 28, reset_layout, {0} },
{ 29, reorganizetags, {0} }, { 29, reorganizetags, {0} },
{ 30, quit, {1} }, { 30, quit, {1} },
{ 31, quit, {0} }, { 31, quit, {0} },

View file

@ -250,8 +250,9 @@ static unsigned int stairpx = 20; /* depth of the stairs layou
static int stairdirection = 1; /* 0: left-aligned, 1: right-aligned */ static int stairdirection = 1; /* 0: left-aligned, 1: right-aligned */
static int stairsamesize = 1; /* 1 means shrink all the staired windows to the same size */ static int stairsamesize = 1; /* 1 means shrink all the staired windows to the same size */
#endif #endif
static int defaultlayout = 1; /* Reset layout when there is only one client visible */ static int resetlayout = 1; /* Reset layout when there is only one client visible */
static int defaultmfact = 1; /* Reset mfact when there is only one client visible */ static int resetmfact = 1; /* Reset mfact when there is only one client visible */
static int resetgaps = 1; /* Reset gaps when there is only one client visible */
#if LAYOUT_DGRID #if LAYOUT_DGRID
static int forcevsplit = 1; /* Force two clients to always split vertically in the dynamic grid layout */ static int forcevsplit = 1; /* Force two clients to always split vertically in the dynamic grid layout */
#endif #endif

View file

@ -401,7 +401,7 @@ static void propertynotify(XEvent *e);
static void quit(const Arg *arg); static void quit(const Arg *arg);
static Client *recttoclient(int x, int y, int w, int h); static Client *recttoclient(int x, int y, int w, int h);
static Monitor *recttomon(int x, int y, int w, int h); static Monitor *recttomon(int x, int y, int w, int h);
static void resetlayout(const Arg *arg); static void reset_layout(const Arg *arg);
static void reorganizetags(const Arg *arg); static void reorganizetags(const Arg *arg);
static void resize(Client *c, int x, int y, int w, int h, int interact); static void resize(Client *c, int x, int y, int w, int h, int interact);
static void resizeclient(Client *c, int x, int y, int w, int h); static void resizeclient(Client *c, int x, int y, int w, int h);
@ -3581,19 +3581,23 @@ recttomon(int x, int y, int w, int h)
} }
void void
resetlayout(const Arg *arg) reset_layout(const Arg *arg)
{ {
Arg default_layout = {.v = &layouts[0]}; Arg default_layout = {.v = &layouts[0]};
Arg default_mfact = {.f = mfact + 1}; Arg default_mfact = {.f = mfact + 1};
if (defaultlayout) { if (resetlayout) {
setlayout(&default_layout); setlayout(&default_layout);
selmon->isreset = 1; selmon->isreset = 1;
} }
if (defaultmfact) { if (resetmfact) {
setmfact(&default_mfact); setmfact(&default_mfact);
} }
if (enablegaps && resetgaps) {
defaultgaps(NULL);
}
} }
void void
@ -3650,7 +3654,7 @@ resizeclient(Client *c, int x, int y, int w, int h)
wc.border_width = c->bw; wc.border_width = c->bw;
if ((nexttiled(c->mon->clients) == c) && !(nexttiled(c->next))) if ((nexttiled(c->mon->clients) == c) && !(nexttiled(c->next)))
resetlayout(NULL); reset_layout(NULL);
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c); configure(c);

View file

@ -165,8 +165,9 @@ ResourcePref resources[] = {
#if USEFADE #if USEFADE
{ "fadeinactive", INTEGER, &fadeinactive }, { "fadeinactive", INTEGER, &fadeinactive },
#endif #endif
{ "defaultlayout", INTEGER, &defaultlayout }, { "resetlayout", INTEGER, &resetlayout },
{ "defaultmfact", INTEGER, &defaultmfact }, { "resetmfact", INTEGER, &resetmfact },
{ "resetgaps", INTEGER, &resetgaps },
{ "wmclass", INTEGER, &wmclass }, { "wmclass", INTEGER, &wmclass },
{ "clicktofocus", INTEGER, &clicktofocus }, { "clicktofocus", INTEGER, &clicktofocus },
{ "roundedcorners", INTEGER, &roundedcorners }, { "roundedcorners", INTEGER, &roundedcorners },