From d1f58218b350d7719e4e9720ab5599c23e4b101d Mon Sep 17 00:00:00 2001 From: dvh Date: Wed, 11 Nov 2026 10:07:32 +0100 Subject: [PATCH] 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. --- dwl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dwl.c b/dwl.c index 921f353..259ebab 100644 --- a/dwl.c +++ b/dwl.c @@ -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);