fix a crash in focusmon() when no monitor is enabled

closemon() sets selmon to NULL when every output is disabled (e.g. turned
off with wlr-randr), and dirtomon() dereferences it.
This commit is contained in:
dvh
2026-11-11 10:54:13 +01:00
parent 8fde769b78
commit d1f58218b3
+2
View File
@@ -1702,6 +1702,8 @@ void
focusmon(const Arg *arg)
{
int i = 0, nmons = wl_list_length(&mons);
if (!selmon)
return;
if (nmons) {
do /* don't switch to disabled mons */
selmon = dirtomon(arg->i);