From 1ea0a43615fa103b28f58648b36ffa2c95366753 Mon Sep 17 00:00:00 2001 From: Visal Vijay <150381094+B2krobbery@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:23:12 +0530 Subject: 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 --- src/managers/input/InputManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/managers/input/InputManager.cpp') 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. -- cgit v1.2.3