From 0051b078a1af50e0c94b0722d8c757d4e1523bfc Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 5 Apr 2024 16:56:46 +0100 Subject: [PATCH] monitor: check for invalid workspaces in onConnect ref #5443 --- src/helpers/Monitor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 152356e4..80a806d0 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -169,6 +169,9 @@ void CMonitor::onConnect(bool noRule) { setupDefaultWS(monitorRule); for (auto& ws : g_pCompositor->m_vWorkspaces) { + if (!valid(ws)) + continue; + if (ws->m_szLastMonitor == szName || g_pCompositor->m_vMonitors.size() == 1 /* avoid lost workspaces on recover */) { g_pCompositor->moveWorkspaceToMonitor(ws, this); ws->startAnim(true, true, true);