diff options
| author | Visal Vijay <150381094+B2krobbery@users.noreply.github.com> | 2026-04-16 22:23:12 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-16 17:53:12 +0100 |
| commit | 1ea0a43615fa103b28f58648b36ffa2c95366753 (patch) | |
| tree | aa82e2a2b5fafe5d8c16df33175c19ad420b3aef /src/managers/input/InputManager.cpp | |
| parent | ed349e84d26f35a6ef20019f7315ddfd85d1e7ee (diff) | |
monocle: avoid repeated workspace monitor lock() calls (#14085)
* refactor(monocle): avoid repeated workspace monitor lock() calls
* clang-format
* cleanup: avoid repeated weak_ptr::lock() calls
* style: shorten variable name PMONITORWORKSPACEOWNER to PMONITOR
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index d1dafbc9..95e7704a 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -626,8 +626,11 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st m_lastFocusOnLS = false; return; // don't enter any new surfaces } else { - if (allowKeyboardRefocus && ((FOLLOWMOUSE != 3 && (*PMOUSEREFOCUS || m_lastMouseFocus.lock() != pFoundWindow)) || refocus)) { - if (m_lastMouseFocus.lock() != pFoundWindow || Desktop::focusState()->window() != pFoundWindow || Desktop::focusState()->surface() != foundSurface || refocus) { + auto lastFocus = m_lastMouseFocus.lock(); + + if (allowKeyboardRefocus && ((FOLLOWMOUSE != 3 && (*PMOUSEREFOCUS || lastFocus != pFoundWindow)) || refocus)) { + if (lastFocus != pFoundWindow || Desktop::focusState()->window() != pFoundWindow || Desktop::focusState()->surface() != foundSurface || refocus) { + m_lastMouseFocus = pFoundWindow; // TODO: this looks wrong. When over a popup, it constantly is switching. |
