[PATCH libinput 02/24] evdev: use an axis_frame event to mark the end of axis changes

Carlos Garnacho carlosg at gnome.org
Mon Apr 21 10:11:11 PDT 2014


It will be unlikely in this case to get both REL_WHEEL and REL_HWHEEL
on a single EV_SYN, but for completeness.

Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
---
 src/evdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/evdev.c b/src/evdev.c
index 901b310..94fe67b 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -335,6 +335,7 @@ evdev_process_relative(struct evdev_device *device,
 		       struct input_event *e, uint32_t time)
 {
 	struct libinput_device *base = &device->base;
+	int need_frame = 0;
 
 	switch (e->code) {
 	case REL_X:
@@ -356,6 +357,7 @@ evdev_process_relative(struct evdev_device *device,
 			time,
 			LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL,
 			-1 * e->value * DEFAULT_AXIS_STEP_DISTANCE);
+		need_frame = 1;
 		break;
 	case REL_HWHEEL:
 		evdev_flush_pending_event(device, time);
@@ -369,12 +371,16 @@ evdev_process_relative(struct evdev_device *device,
 				time,
 				LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL,
 				e->value * DEFAULT_AXIS_STEP_DISTANCE);
+			need_frame = 1;
 			break;
 		default:
 			break;
 
 		}
 	}
+
+	if (need_frame)
+		pointer_notify_axis_frame(base, time);
 }
 
 static inline void
-- 
1.9.0



More information about the wayland-devel mailing list