Only reset number of clients in master area to default

This commit is contained in:
Alex Kotov 2021-11-14 02:36:36 +05:00
parent 738de100cb
commit 16f841ef53
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 2 additions and 2 deletions

View File

@ -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} },

2
dwm.c
View File

@ -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