~ruther/dwl

406aebcbd2d9526834ad4131ac8b454a9f27c0d9 — Leonardo Hernández Hernández 2 years ago dfcd142
prevent an infinite loop if try to use focusmon() with all monitors disabled
1 files changed, 5 insertions(+), 3 deletions(-)

M dwl.c
M dwl.c => dwl.c +5 -3
@@ 1192,9 1192,11 @@ focusclient(Client *c, int lift)
void
focusmon(const Arg *arg)
{
	do
		selmon = dirtomon(arg->i);
	while (!selmon->wlr_output->enabled);
	int i = 0, nmons = wl_list_length(&mons);
	if (nmons)
		do /* don't switch to disabled mons */
			selmon = dirtomon(arg->i);
		while (!selmon->wlr_output->enabled && i++ < nmons);
	focusclient(focustop(selmon), 1);
}


Do not follow this link