mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-11-04 06:31:54 +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:
		
				
					committed by
					
						
						Geoffrey McRae
					
				
			
			
				
	
			
			
			
						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");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user