[weston,12/17] libinput: Expose unaccelerated motion deltas in motion event struct

Submitted by Jonas Ådahl on Dec. 2, 2014, 1:49 p.m.

Details

Message ID 1417528165-9319-13-git-send-email-jadahl@gmail.com
State Superseded
Delegated to: Daniel Stone
Headers show

Not browsing as part of any series.

Commit Message

Jonas Ådahl Dec. 2, 2014, 1:49 p.m.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
---
 src/compositor.h      | 3 +++
 src/libinput-device.c | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/compositor.h b/src/compositor.h
index 6bcddf5..b622c97 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -239,6 +239,7 @@  struct weston_output {
 enum weston_pointer_motion_mask {
 	WESTON_POINTER_MOTION_ABS = 1 << 0,
 	WESTON_POINTER_MOTION_REL = 1 << 1,
+	WESTON_POINTER_MOTION_REL_NOACCEL = 1 << 2,
 };
 
 struct weston_pointer_motion_event {
@@ -247,6 +248,8 @@  struct weston_pointer_motion_event {
 	wl_fixed_t y;
 	wl_fixed_t dx;
 	wl_fixed_t dy;
+	wl_fixed_t dx_noaccel;
+	wl_fixed_t dy_noaccel;
 };
 
 struct weston_pointer_grab;
diff --git a/src/libinput-device.c b/src/libinput-device.c
index b815b43..73d28e4 100644
--- a/src/libinput-device.c
+++ b/src/libinput-device.c
@@ -76,11 +76,16 @@  handle_pointer_motion(struct libinput_device *libinput_device,
 	struct weston_pointer_motion_event event = { 0 };
 
 	event = (struct weston_pointer_motion_event) {
-		.mask = WESTON_POINTER_MOTION_REL,
+		.mask = WESTON_POINTER_MOTION_REL |
+			WESTON_POINTER_MOTION_REL_NOACCEL,
 		.dx = wl_fixed_from_double(
 			libinput_event_pointer_get_dx(pointer_event)),
 		.dy = wl_fixed_from_double(
 			libinput_event_pointer_get_dy(pointer_event)),
+		.dx_noaccel = wl_fixed_from_double(
+			libinput_event_pointer_get_dx_noaccel(pointer_event)),
+		.dy_noaccel = wl_fixed_from_double(
+			libinput_event_pointer_get_dy_noaccel(pointer_event)),
 	};
 
 	notify_motion(device->seat,