evdev: Fix vertical high-resolution mouse wheel scaling

This commit fixes a regression introduced by c44fa5bb

The evdev backend currently uses high_res_hwheel to select the
normalization denominator for both horizontal and vertical wheel
events.

This causes devices which advertise REL_WHEEL_HI_RES but not
REL_HWHEEL_HI_RES to report vertical wheel movement 120 times
larger than intended.

Use the corresponding high-resolution capability independently for
each axis, restoring the behavior before c44fa5bb.
This commit is contained in:
Revincx
2026-08-10 09:08:21 -07:00
committed by Sam Lantinga
parent b340ddcd7b
commit b640b804a8
+2 -3
View File
@@ -516,11 +516,10 @@ void SDL_EVDEV_Poll(void)
if (item->mouse_wheel != 0 || item->mouse_hwheel != 0) {
Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
const float denom = (item->high_res_hwheel ? 120.0f : 1.0f);
SDL_SendMouseWheel(timestamp,
mouse->focus, (SDL_MouseID)item->fd,
item->mouse_hwheel / denom,
item->mouse_wheel / denom,
item->mouse_hwheel / (item->high_res_hwheel ? 120.0f : 1.0f),
item->mouse_wheel / (item->high_res_wheel ? 120.0f : 1.0f),
SDL_MOUSEWHEEL_NORMAL);
item->mouse_wheel = item->mouse_hwheel = 0;
}