From 9868b18378e99c8123a24fa4b152a58d5c0bfe67 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 30 Apr 2025 00:31:15 +0100 Subject: [PATCH] input: don't use pointer hold logic for unmapped surfs fixes #10215 --- src/desktop/LayerSurface.cpp | 2 +- src/managers/input/InputManager.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index 96c6200e..dcbf35fe 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -199,7 +199,7 @@ void CLayerSurface::onUnmap() { g_pEventManager->postEvent(SHyprIPCEvent{"closelayer", m_layerSurface->layerNamespace}); EMIT_HOOK_EVENT("closeLayer", m_self.lock()); - std::erase_if(g_pInputManager->m_dExclusiveLSes, [this](const auto& other) { return !other.lock() || other.lock() == m_self.lock(); }); + std::erase_if(g_pInputManager->m_dExclusiveLSes, [this](const auto& other) { return !other || other == m_self; }); if (!m_monitor || g_pCompositor->m_unsafeState) { Debug::log(WARN, "Layersurface unmapping on invalid monitor (removed?) ignoring."); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 3c9c59b9..ab5e59a0 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -289,7 +289,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) { // if we are holding a pointer button, // and we're not dnd-ing, don't refocus. Keep focus on last surface. - if (!PROTO::data->dndActive() && !m_lCurrentlyHeldButtons.empty() && g_pCompositor->m_lastFocus && g_pSeatManager->state.pointerFocus && !m_bHardInput) { + if (!PROTO::data->dndActive() && !m_lCurrentlyHeldButtons.empty() && g_pCompositor->m_lastFocus && g_pCompositor->m_lastFocus->mapped && g_pSeatManager->state.pointerFocus && + !m_bHardInput) { foundSurface = g_pSeatManager->state.pointerFocus.lock(); // IME popups aren't desktop-like elements