diff options
| author | Zach DeCook <zachdecook@librem.one> | 2024-01-12 09:43:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-12 15:43:16 +0100 |
| commit | c4da4b026deefd58f532353b64e9f17130e760ca (patch) | |
| tree | 0b2096a5c61af1f79feb95fe5e52939ea53434df /src/managers/input/InputManager.cpp | |
| parent | babb9c07b045e21b5549cdcc3096d677e9db35b3 (diff) | |
layershell: Fix greedy mouse grab from keyboard_interactive layer (#4401)
* Layer: Don't allow a keyboard-layer to steal focus from other layers
* Input: Don't change keyboard focus on click if focus is locked
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 207df738..8bfdb65c 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -359,7 +359,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { bool allowKeyboardRefocus = true; - if (!refocus && g_pCompositor->m_pLastFocus) { + if (g_pCompositor->m_pLastFocus) { const auto PLS = g_pCompositor->getLayerSurfaceFromSurface(g_pCompositor->m_pLastFocus); if (PLS && PLS->layerSurface->current.keyboard_interactive == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE) @@ -421,7 +421,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { m_bLastFocusOnLS = false; return; // don't enter any new surfaces } else { - if (((FOLLOWMOUSE != 3 && allowKeyboardRefocus) && (*PMOUSEREFOCUS || m_pLastMouseFocus != pFoundWindow)) || refocus) { + if (allowKeyboardRefocus && ((FOLLOWMOUSE != 3 && (*PMOUSEREFOCUS || m_pLastMouseFocus != pFoundWindow)) || refocus)) { m_pLastMouseFocus = pFoundWindow; g_pCompositor->focusWindow(pFoundWindow, foundSurface); } |
