From 16f841ef53b088d3a023d3f39109030827095441 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 14 Nov 2021 02:36:36 +0500 Subject: [PATCH] Only reset number of clients in master area to default --- config.def.h | 2 +- dwm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index 33fa900..ee60191 100644 --- a/config.def.h +++ b/config.def.h @@ -73,7 +73,7 @@ static Key keys[] = { { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY|ShiftMask, XK_i, resetnmaster, {.i = nmaster } }, + { MODKEY|ShiftMask, XK_i, resetnmaster, {.i = 1 } }, { MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY|ShiftMask, XK_d, resetnmaster, {.i = 0 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, diff --git a/dwm.c b/dwm.c index 0093a52..397e384 100644 --- a/dwm.c +++ b/dwm.c @@ -1630,7 +1630,7 @@ void resetnmaster(const Arg *arg) { const int max_clients_in_master = settings_get_max_clients_in_master(); - const int new_clients_in_master = MAX(0, arg->i); + const int new_clients_in_master = arg->i == 0 ? 0 : nmaster; selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = max_clients_in_master == 0