2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-09-04 00:05:15 +00:00

Fix HID mouse support with SDL precise scrolling

Over HID, only integral scroll values can be sent. When SDL precise
scrolling is active, scroll events may include fractional values (e.g.,
0.05), which are truncated to 0 in the HID event.

To fix the problem, use the integral scroll value reported by SDL, which
internally accumulates fractional deltas.

Fixes #6156 <https://github.com/Genymobile/scrcpy/issues/6156>
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172>
This commit is contained in:
Romain Vimont
2025-06-18 18:26:13 +02:00
parent 7c8bdccbdc
commit fc75319bb2
7 changed files with 26 additions and 7 deletions

View File

@@ -903,6 +903,8 @@ sc_input_manager_process_mouse_wheel(struct sc_input_manager *im,
.hscroll = event->x,
.vscroll = event->y,
#endif
.hscroll_int = event->x,
.vscroll_int = event->y,
.buttons_state = im->mouse_buttons_state,
};