summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-04 18:42:11 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-04 18:42:11 +0200
commitba0c5fe0bba9ac671f4238b968e4728671eef3f8 (patch)
tree828802c3b10fd7dde2bdf3e73d39455986ac6bb5 /src/managers/input/InputManager.cpp
parentf6ecef0959163d10dd6597037192456977aa5bc2 (diff)
fix mouse focus not returning from a LS on follow mouse 0
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index e4173a6d..af950b5b 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -269,9 +269,11 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
}
- if (pFoundWindow == g_pCompositor->m_pLastWindow && foundSurface != g_pCompositor->m_pLastFocus) {
- // we changed the subsurface
- wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
+ if (pFoundWindow == g_pCompositor->m_pLastWindow) {
+ if (foundSurface != g_pCompositor->m_pLastFocus || m_bLastFocusOnLS) {
+ // ^^^ changed the subsurface ^^^ came back from a LS
+ wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
+ }
}
if (*PFOLLOWONDND && m_sDrag.dragIcon) {
@@ -279,16 +281,22 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
}
wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, time, surfaceLocal.x, surfaceLocal.y);
+ m_bLastFocusOnLS = false;
return; // don't enter any new surfaces
} else {
if ((*PFOLLOWMOUSE != 3 && allowKeyboardRefocus) || refocus)
g_pCompositor->focusWindow(pFoundWindow, foundSurface);
}
+
+ m_bLastFocusOnLS = false;
} else {
if (pFoundLayerSurface && pFoundLayerSurface->layerSurface->current.keyboard_interactive && *PFOLLOWMOUSE != 3 && allowKeyboardRefocus) {
g_pCompositor->focusSurface(foundSurface);
g_pCompositor->m_pLastWindow = nullptr; // reset last window as we have a full focus on a LS
}
+
+ if (pFoundLayerSurface)
+ m_bLastFocusOnLS = true;
}
wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);