From b9ddb4bb26275115e9c9ff03b3d87c6e2fd96c45 Mon Sep 17 00:00:00 2001 From: matjam Date: Mon, 9 Mar 2026 14:45:21 -0700 Subject: layout: fix crash on monitor reconnect due to stale workspace state Guard against null/expired workspace and monitor pointers during layout recalculation triggered by arrangeMonitors after sleep/wake. --- src/layout/algorithm/Algorithm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/layout/algorithm/Algorithm.cpp') diff --git a/src/layout/algorithm/Algorithm.cpp b/src/layout/algorithm/Algorithm.cpp index cfb5b7e3..b83a03a3 100644 --- a/src/layout/algorithm/Algorithm.cpp +++ b/src/layout/algorithm/Algorithm.cpp @@ -105,7 +105,10 @@ void CAlgorithm::recalculate() { m_floating->recalculate(); const auto PWORKSPACE = m_space->workspace(); - const auto PMONITOR = PWORKSPACE->m_monitor; + if (!PWORKSPACE) + return; + + const auto PMONITOR = PWORKSPACE->m_monitor; if (PWORKSPACE->m_hasFullscreenWindow && PMONITOR) { // massive hack from the fullscreen func -- cgit v1.2.3