diff options
author | Vaxry <[email protected]> | 2024-02-15 01:24:40 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-02-15 01:24:40 +0000 |
commit | 3cca36e7738559bbc72ac8fc99eaca3e3d94c0cb (patch) | |
tree | 62a942d7319a1b720cf531ff3c9be19bea5e7a01 /src/managers/input/InputManager.cpp | |
parent | ef490965a23e043692584ae26dec4f863c88f2f6 (diff) | |
download | Hyprland-3cca36e7738559bbc72ac8fc99eaca3e3d94c0cb.tar.gz Hyprland-3cca36e7738559bbc72ac8fc99eaca3e3d94c0cb.zip |
input: avoid rampant refocuses on popups
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r-- | src/managers/input/InputManager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 76fcf1df..baf648df 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -422,8 +422,16 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { return; // don't enter any new surfaces } else { if (allowKeyboardRefocus && ((FOLLOWMOUSE != 3 && (*PMOUSEREFOCUS || m_pLastMouseFocus != pFoundWindow)) || refocus)) { - m_pLastMouseFocus = pFoundWindow; - g_pCompositor->focusWindow(pFoundWindow, foundSurface); + if (m_pLastMouseFocus != pFoundWindow || g_pCompositor->m_pLastFocus != foundSurface) { + m_pLastMouseFocus = pFoundWindow; + + // TODO: this looks wrong. When over a popup, it constantly is switching. + // Temp fix until that's figured out. Otherwise spams windowrule lookups and other shit. + if (m_pLastMouseFocus != pFoundWindow) + g_pCompositor->focusWindow(pFoundWindow, foundSurface); + else + g_pCompositor->focusSurface(foundSurface, pFoundWindow); + } } } |