diff options
author | Maximilian Seidler <[email protected]> | 2024-09-04 10:23:29 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-04 11:23:29 +0100 |
commit | ea10592ad3c861ff2ce73ad7785bcb5a45a9e400 (patch) | |
tree | 2facb09032dbedcd26924c20b8de5b32b878f0bb /src | |
parent | 9b54342baa27d8de0460e1103ec4c3cc65592ed8 (diff) | |
download | Hyprland-ea10592ad3c861ff2ce73ad7785bcb5a45a9e400.tar.gz Hyprland-ea10592ad3c861ff2ce73ad7785bcb5a45a9e400.zip |
input: don't emit idle activity when calling simulateMouseMovement (#7649)
Diffstat (limited to 'src')
-rw-r--r-- | src/managers/input/InputManager.cpp | 6 | ||||
-rw-r--r-- | src/managers/input/InputManager.hpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 78c9e437..d7ccc5e4 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -111,7 +111,7 @@ void CInputManager::simulateMouseMovement() { timespec now; clock_gettime(CLOCK_MONOTONIC, &now); m_vLastCursorPosFloored = m_vLastCursorPosFloored - Vector2D(1, 1); // hack: force the mouseMoveUnified to report without making this a refocus. - mouseMoveUnified(now.tv_sec * 1000 + now.tv_nsec / 10000000); + mouseMoveUnified(now.tv_sec * 1000 + now.tv_nsec / 10000000, false, true); } void CInputManager::sendMotionEventsToFocused() { @@ -132,7 +132,7 @@ void CInputManager::sendMotionEventsToFocused() { g_pSeatManager->setPointerFocus(g_pCompositor->m_pLastFocus.lock(), LOCAL); } -void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { +void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool silent) { static auto PFOLLOWMOUSE = CConfigValue<Hyprlang::INT>("input:follow_mouse"); static auto PMOUSEREFOCUS = CConfigValue<Hyprlang::INT>("input:mouse_refocus"); static auto PMOUSEDPMS = CConfigValue<Hyprlang::INT>("misc:mouse_move_enables_dpms"); @@ -171,7 +171,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { EMIT_HOOK_EVENT_CANCELLABLE("mouseMove", MOUSECOORDSFLOORED); - if (time) + if (time && !silent) PROTO::idle->onActivity(); m_vLastCursorPosFloored = MOUSECOORDSFLOORED; diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index ebf00b2d..70e4d40f 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -237,7 +237,7 @@ class CInputManager { uint32_t m_uiCapabilities = 0; - void mouseMoveUnified(uint32_t, bool refocus = false); + void mouseMoveUnified(uint32_t, bool refocus = false, bool silent = false); SP<CTabletTool> ensureTabletToolPresent(SP<Aquamarine::ITabletTool>); |