[PATCH libinput 12/12] Store unaccelerated delta as normalized_coords

Peter Hutterer peter.hutterer at who-t.net
Thu Mar 12 01:36:43 PDT 2015


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

diff --git a/src/libinput.c b/src/libinput.c
index 8db6997..96df44a 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -58,10 +58,9 @@ struct libinput_event_pointer {
 	struct libinput_event base;
 	uint32_t time;
 	struct normalized_coords delta;
+	struct normalized_coords delta_unaccel;
 	struct device_coords absolute;
 	struct discrete_coords discrete;
-	double dx_unaccel;
-	double dy_unaccel;
 	uint32_t button;
 	uint32_t seat_button_count;
 	enum libinput_button_state state;
@@ -309,14 +308,14 @@ LIBINPUT_EXPORT double
 libinput_event_pointer_get_dx_unaccelerated(
 	struct libinput_event_pointer *event)
 {
-	return event->dx_unaccel;
+	return event->delta_unaccel.x;
 }
 
 LIBINPUT_EXPORT double
 libinput_event_pointer_get_dy_unaccelerated(
 	struct libinput_event_pointer *event)
 {
-	return event->dy_unaccel;
+	return event->delta_unaccel.y;
 }
 
 LIBINPUT_EXPORT double
@@ -971,8 +970,7 @@ pointer_notify_motion(struct libinput_device *device,
 	*motion_event = (struct libinput_event_pointer) {
 		.time = time,
 		.delta = *delta,
-		.dx_unaccel = unaccel->x,
-		.dy_unaccel = unaccel->y,
+		.delta_unaccel = *unaccel,
 	};
 
 	post_device_event(device, time,
-- 
2.1.0



More information about the wayland-devel mailing list