From ba0c5fe0bba9ac671f4238b968e4728671eef3f8 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 4 Sep 2022 18:42:11 +0200 Subject: fix mouse focus not returning from a LS on follow mouse 0 --- src/managers/input/InputManager.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/managers/input/InputManager.cpp') 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); -- cgit v1.2.3