libinput: Expose unaccelerated motion deltas in motion event struct

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Jonas Ådahl 10 years ago
parent 94e2e2d39f
commit 3845b32d5c
  1. 3
      libweston/compositor.h
  2. 9
      libweston/libinput-device.c

@ -243,6 +243,7 @@ struct weston_output {
enum weston_pointer_motion_mask { enum weston_pointer_motion_mask {
WESTON_POINTER_MOTION_ABS = 1 << 0, WESTON_POINTER_MOTION_ABS = 1 << 0,
WESTON_POINTER_MOTION_REL = 1 << 1, WESTON_POINTER_MOTION_REL = 1 << 1,
WESTON_POINTER_MOTION_REL_UNACCEL = 1 << 2,
}; };
struct weston_pointer_motion_event { struct weston_pointer_motion_event {
@ -251,6 +252,8 @@ struct weston_pointer_motion_event {
double y; double y;
double dx; double dx;
double dy; double dy;
double dx_unaccel;
double dy_unaccel;
}; };
struct weston_pointer_axis_event { struct weston_pointer_axis_event {

@ -86,11 +86,18 @@ handle_pointer_motion(struct libinput_device *libinput_device,
struct evdev_device *device = struct evdev_device *device =
libinput_device_get_user_data(libinput_device); libinput_device_get_user_data(libinput_device);
struct weston_pointer_motion_event event = { 0 }; struct weston_pointer_motion_event event = { 0 };
double dx_unaccel, dy_unaccel;
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated(pointer_event);
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated(pointer_event);
event = (struct weston_pointer_motion_event) { event = (struct weston_pointer_motion_event) {
.mask = WESTON_POINTER_MOTION_REL, .mask = WESTON_POINTER_MOTION_REL |
WESTON_POINTER_MOTION_REL_UNACCEL,
.dx = libinput_event_pointer_get_dx(pointer_event), .dx = libinput_event_pointer_get_dx(pointer_event),
.dy = libinput_event_pointer_get_dy(pointer_event), .dy = libinput_event_pointer_get_dy(pointer_event),
.dx_unaccel = dx_unaccel,
.dy_unaccel = dy_unaccel,
}; };
notify_motion(device->seat, notify_motion(device->seat,

Loading…
Cancel
Save