From c6a3092b45da325ee41e39a76fd527d04580a65e Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 24 Oct 2022 00:14:42 +0100 Subject: [PATCH] more safety around shutting down and mouse movements --- src/Compositor.cpp | 4 ++-- src/managers/input/InputManager.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 37e579cb..8e3ec390 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -241,6 +241,8 @@ void CCompositor::cleanup() { if (!m_sWLDisplay || m_bIsShuttingDown) return; + m_bIsShuttingDown = true; + m_pLastFocus = nullptr; m_pLastWindow = nullptr; @@ -256,8 +258,6 @@ void CCompositor::cleanup() { m_vWorkspaces.clear(); m_vWindows.clear(); - m_bIsShuttingDown = true; - for (auto& m : m_vMonitors) { g_pHyprOpenGL->destroyMonitorResources(m.get()); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 9201da24..64963041 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -39,7 +39,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { m_pFoundLSToFocus = nullptr; m_pFoundWindowToFocus = nullptr; - if (!g_pCompositor->m_bReadyToProcess) + if (!g_pCompositor->m_bReadyToProcess || g_pCompositor->m_bIsShuttingDown) return; if (!g_pCompositor->m_sSeat.mouse) {