From 2e32e202e98e491c9b6a2e09f0713a586fc2c93e Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 29 Oct 2022 22:45:01 +0100 Subject: [PATCH] set lastmonitor in onDisconnect --- src/helpers/Monitor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 39f1b910..17643b3f 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -151,6 +151,9 @@ void CMonitor::onDisconnect() { } } + if (g_pCompositor->m_pLastMonitor == this) + g_pCompositor->m_pLastMonitor = BACKUPMON; + // remove mirror if (pMirrorOf) { pMirrorOf->mirrors.erase(std::find_if(pMirrorOf->mirrors.begin(), pMirrorOf->mirrors.end(), [&](const auto& other) { return other == this; }));