mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-26 19:26:32 +00:00
prevent an infinite loop if try to use focusmon() with all monitors disabled
This commit is contained in:
parent
dfcd142ce4
commit
406aebcbd2
1 changed files with 5 additions and 3 deletions
8
dwl.c
8
dwl.c
|
@ -1192,9 +1192,11 @@ focusclient(Client *c, int lift)
|
||||||
void
|
void
|
||||||
focusmon(const Arg *arg)
|
focusmon(const Arg *arg)
|
||||||
{
|
{
|
||||||
do
|
int i = 0, nmons = wl_list_length(&mons);
|
||||||
selmon = dirtomon(arg->i);
|
if (nmons)
|
||||||
while (!selmon->wlr_output->enabled);
|
do /* don't switch to disabled mons */
|
||||||
|
selmon = dirtomon(arg->i);
|
||||||
|
while (!selmon->wlr_output->enabled && i++ < nmons);
|
||||||
focusclient(focustop(selmon), 1);
|
focusclient(focustop(selmon), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue