mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] spice: properly handle high-precision scroll wheel input
Some setups (e.g. Wayland) have high precision scroll wheel input, such that the y-delta on an event may exceed 1. In these cases, scrolling up currently gets treated as scrolling down. This commit changes the checks to use > 0 rather than == 1. This is the approach suggested in https://wiki.libsdl.org/SDL_MouseWheelEvent.
This commit is contained in:
parent
78b1f64a61
commit
d997f0d18c
@ -1332,8 +1332,8 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||
break;
|
||||
|
||||
if (
|
||||
!spice_mouse_press (event->wheel.y == 1 ? 4 : 5) ||
|
||||
!spice_mouse_release(event->wheel.y == 1 ? 4 : 5)
|
||||
!spice_mouse_press (event->wheel.y > 0 ? 4 : 5) ||
|
||||
!spice_mouse_release(event->wheel.y > 0 ? 4 : 5)
|
||||
)
|
||||
{
|
||||
DEBUG_ERROR("SDL_MOUSEWHEEL: failed to send messages");
|
||||
|
Loading…
Reference in New Issue
Block a user