[PATCH libinput] evdev: don't post a relative motion event for dx/dy 0/0

Peter Hutterer peter.hutterer at who-t.net
Sun May 25 22:41:33 PDT 2014


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

diff --git a/src/evdev.c b/src/evdev.c
index fedc324..6aa0d46 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -134,10 +134,12 @@ evdev_flush_pending_event(struct evdev_device *device, uint32_t time)
 		/* Apply pointer acceleration. */
 		filter_dispatch(device->pointer.filter, &motion, device, time);
 
-		pointer_notify_motion(base,
-				      time,
-				      li_fixed_from_double(motion.dx),
-				      li_fixed_from_double(motion.dy));
+		x = li_fixed_from_double(motion.dx);
+		y = li_fixed_from_double(motion.dy);
+
+		if (x != 0 || y != 0)
+			pointer_notify_motion(base, time, x, y);
+
 		device->rel.dx = 0;
 		device->rel.dy = 0;
 		break;
-- 
1.9.3



More information about the wayland-devel mailing list