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 <agent00ming9366@gmail.com>
This commit is contained in:
Agent00Ming 2024-05-16 08:30:55 -04:00 committed by GitHub
parent d693c44836
commit 3ac0e7ead1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -298,6 +298,9 @@ void CSeatManager::sendPointerAxis(uint32_t timeMs, wl_pointer_axis axis, double
p->sendAxisSource(source); p->sendAxisSource(source);
p->sendAxisRelativeDirection(axis, relative); p->sendAxisRelativeDirection(axis, relative);
if (source == 0)
p->sendAxisDiscrete(axis, discrete);
if (value == 0) if (value == 0)
p->sendAxisStop(timeMs, axis); p->sendAxisStop(timeMs, axis);
} }

View file

@ -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() { Vector2D CInputManager::getMouseCoordsInternal() {