prevent an infinite loop if try to use focusmon() with all monitors disabled

This commit is contained in:
Leonardo Hernández Hernández 2022-08-13 19:57:20 -05:00
parent 7a343b98cf
commit d7fae8e19c
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

7
dwl.c
View File

@ -1199,9 +1199,12 @@ focusclient(Client *c, int lift)
void
focusmon(const Arg *arg)
{
do
Monitor *m = selmon;
do {
selmon = dirtomon(arg->i);
while (!selmon->wlr_output->enabled);
if (!selmon || selmon == m)
break;
} while (!selmon->wlr_output->enabled);
focusclient(focustop(selmon), 1);
}