From d8ee624e35f424334fdc439b8ad269455b178004 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 19 Jan 2023 16:27:04 +0100 Subject: [PATCH] move monitor remove notice up --- src/helpers/Monitor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index c728aeb4e..db3799fb4 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -199,6 +199,10 @@ void CMonitor::onDisconnect() { m_aLayerSurfaceLists[i].clear(); } + Debug::log(LOG, "Removed monitor %s!", szName.c_str()); + + g_pEventManager->postEvent(SHyprIPCEvent{"monitorremoved", szName}); + if (!BACKUPMON) { Debug::log(WARN, "Unplugged last monitor, entering an unsafe state. Good luck my friend."); @@ -239,10 +243,6 @@ void CMonitor::onDisconnect() { std::erase_if(g_pCompositor->m_vWorkspaces, [&](std::unique_ptr& el) { return el->m_iMonitorID == ID; }); - Debug::log(LOG, "Removed monitor %s!", szName.c_str()); - - g_pEventManager->postEvent(SHyprIPCEvent{"monitorremoved", szName}); - if (g_pCompositor->m_pLastMonitor == this) g_pCompositor->setActiveMonitor(BACKUPMON);