aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-02-15 01:24:40 +0000
committerVaxry <[email protected]>2024-02-15 01:24:40 +0000
commit3cca36e7738559bbc72ac8fc99eaca3e3d94c0cb (patch)
tree62a942d7319a1b720cf531ff3c9be19bea5e7a01 /src/managers/input/InputManager.cpp
parentef490965a23e043692584ae26dec4f863c88f2f6 (diff)
downloadHyprland-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.cpp12
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);
+ }
}
}