From 3ac0e7ead1434c172f276a12f81da1eeb0dc4491 Mon Sep 17 00:00:00 2001 From: Agent00Ming <107314235+Agent00Ming@users.noreply.github.com> Date: Thu, 16 May 2024 08:30:55 -0400 Subject: [PATCH] seat: Send discrete event when axis source is scroll wheel (#6103) modified: src/managers/SeatManager.cpp modified: src/managers/input/InputManager.cpp Co-authored-by: Agent_00Ming --- src/managers/SeatManager.cpp | 3 +++ src/managers/input/InputManager.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/managers/SeatManager.cpp b/src/managers/SeatManager.cpp index 2c7bfe39..2087122a 100644 --- a/src/managers/SeatManager.cpp +++ b/src/managers/SeatManager.cpp @@ -298,6 +298,9 @@ void CSeatManager::sendPointerAxis(uint32_t timeMs, wl_pointer_axis axis, double p->sendAxisSource(source); p->sendAxisRelativeDirection(axis, relative); + if (source == 0) + p->sendAxisDiscrete(axis, discrete); + if (value == 0) p->sendAxisStop(timeMs, axis); } diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 02072229..58e5ad17 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -774,7 +774,7 @@ void CInputManager::onMouseWheel(IPointer::SAxisEvent e) { } } - g_pSeatManager->sendPointerAxis(e.timeMs, e.axis, factor * e.delta, std::round(factor * e.deltaDiscrete), e.source, WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL); + g_pSeatManager->sendPointerAxis(e.timeMs, e.axis, factor * e.delta, std::round(factor * e.deltaDiscrete / 120), e.source, WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL); } Vector2D CInputManager::getMouseCoordsInternal() {