summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-10-26 18:54:07 +0100
committerVaxry <vaxry@vaxry.net>2023-10-26 18:54:19 +0100
commit92cf1c23371e35fa352da13305d8489a9e08d540 (patch)
tree7fa5cf7cb18c1a059bc77943a85bfacd3341dd57 /src/managers/input/InputManager.cpp
parent07714dd5bd9ff60e10170e11b535409e1bbc92ef (diff)
input: fix mouse down handling on unset last surface
fixes #3659
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 95240d1a..d2cb27b8 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -182,7 +182,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
// update stuff
updateDragIcon();
- if (!m_sDrag.drag && !m_lCurrentlyHeldButtons.empty() && g_pCompositor->m_pLastFocus) {
+ if (!m_sDrag.drag && !m_lCurrentlyHeldButtons.empty() && g_pCompositor->m_pLastFocus && m_pLastMouseSurface) {
if (m_bLastFocusOnLS) {
foundSurface = m_pLastMouseSurface;
pFoundLayerSurface = g_pCompositor->getLayerSurfaceFromSurface(foundSurface);
@@ -310,6 +310,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
}
wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat);
+ m_pLastMouseSurface = nullptr;
if (refocus || !g_pCompositor->m_pLastWindow) // if we are forcing a refocus, and we don't find a surface, clear the kb focus too!
g_pCompositor->focusWindow(nullptr);