[PATCH libinput 2/4] evdev: check the button scrolling state instead of the hw button state

Peter Hutterer peter.hutterer at who-t.net
Mon Apr 11 03:54:56 UTC 2016


The state of button scrolling should determine whether we filter the event,
not the hardware button state.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 9be4a96..e272f4b 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -273,13 +273,12 @@ evdev_post_trackpoint_scroll(struct evdev_device *device,
 			     uint64_t time)
 {
 	if (device->scroll.method != LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN ||
-	    !hw_is_key_down(device, device->scroll.button))
+	    !device->scroll.button_scroll_active)
 		return false;
 
-	if (device->scroll.button_scroll_active)
-		evdev_post_scroll(device, time,
-				  LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS,
-				  &unaccel);
+	evdev_post_scroll(device, time,
+			  LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS,
+			  &unaccel);
 
 	return true;
 }
-- 
2.5.5



More information about the wayland-devel mailing list