Fix code of nmaxmaster patch
This commit is contained in:
parent
4d040f377b
commit
37af14efcb
2 changed files with 8 additions and 5 deletions
11
dwm.c
11
dwm.c
|
@ -1180,10 +1180,13 @@ grabkeys(void)
|
|||
void
|
||||
incnmaster(const Arg *arg)
|
||||
{
|
||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MIN(
|
||||
MAX(selmon->nmaster + arg->i, 0),
|
||||
MAX(settings_get_max_clients_in_master(), 1)
|
||||
);
|
||||
const int max_clients_in_master = settings_get_max_clients_in_master();
|
||||
const int new_clients_in_master = MAX(0, selmon->nmaster + arg->i);
|
||||
|
||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] =
|
||||
max_clients_in_master == 0
|
||||
? new_clients_in_master
|
||||
: MIN(new_clients_in_master, max_clients_in_master);
|
||||
|
||||
arrange(selmon);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ void settings_set_focus_on_wheel(const bool new_focus_on_wheel)
|
|||
|
||||
int settings_get_max_clients_in_master()
|
||||
{
|
||||
return max_clients_in_master;
|
||||
return max_clients_in_master > 0 ? max_clients_in_master : 0;
|
||||
}
|
||||
|
||||
void settings_set_max_clients_in_master(const int new_max_clients_in_master)
|
||||
|
|
Loading…
Reference in a new issue