input: don't emit idle activity when calling simulateMouseMovement (#7649)

This commit is contained in:
Maximilian Seidler 2024-09-04 10:23:29 +00:00 committed by GitHub
parent 9b54342baa
commit ea10592ad3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -111,7 +111,7 @@ void CInputManager::simulateMouseMovement() {
timespec now; timespec now;
clock_gettime(CLOCK_MONOTONIC, &now); clock_gettime(CLOCK_MONOTONIC, &now);
m_vLastCursorPosFloored = m_vLastCursorPosFloored - Vector2D(1, 1); // hack: force the mouseMoveUnified to report without making this a refocus. 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() { void CInputManager::sendMotionEventsToFocused() {
@ -132,7 +132,7 @@ void CInputManager::sendMotionEventsToFocused() {
g_pSeatManager->setPointerFocus(g_pCompositor->m_pLastFocus.lock(), LOCAL); 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 PFOLLOWMOUSE = CConfigValue<Hyprlang::INT>("input:follow_mouse");
static auto PMOUSEREFOCUS = CConfigValue<Hyprlang::INT>("input:mouse_refocus"); static auto PMOUSEREFOCUS = CConfigValue<Hyprlang::INT>("input:mouse_refocus");
static auto PMOUSEDPMS = CConfigValue<Hyprlang::INT>("misc:mouse_move_enables_dpms"); 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); EMIT_HOOK_EVENT_CANCELLABLE("mouseMove", MOUSECOORDSFLOORED);
if (time) if (time && !silent)
PROTO::idle->onActivity(); PROTO::idle->onActivity();
m_vLastCursorPosFloored = MOUSECOORDSFLOORED; m_vLastCursorPosFloored = MOUSECOORDSFLOORED;

View file

@ -237,7 +237,7 @@ class CInputManager {
uint32_t m_uiCapabilities = 0; 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>); SP<CTabletTool> ensureTabletToolPresent(SP<Aquamarine::ITabletTool>);