diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2014-10-05 21:39:14 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2015-11-20 11:44:56 +0800 |
commit | d2510105a6e411790f3d5bd3acd1e0d0e295ff06 (patch) | |
tree | 69857f69085216be3028c0a60ef8c9ac5d2a26d6 /src/data-device.c | |
parent | 870fadced3f19659b60574888432b79713776097 (diff) | |
download | weston-d2510105a6e411790f3d5bd3acd1e0d0e295ff06.tar.gz |
input: Make pointer grab motion callbacks take an event struct
Instead of only passing absolute pointer coordinates, effectively
loosing motion event data, pass a struct that can potentially contain
different types of motion events, currently being absolute and relative.
A helper function to get resulting absolute coordinates was added for
when previous callbacks simply used the (x, y) coordinates.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'src/data-device.c')
-rw-r--r-- | src/data-device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/data-device.c b/src/data-device.c index 66c4c7a3..d3ead5f9 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -334,7 +334,7 @@ drag_grab_focus(struct weston_pointer_grab *grab) static void drag_grab_motion(struct weston_pointer_grab *grab, uint32_t time, - wl_fixed_t x, wl_fixed_t y) + struct weston_pointer_motion_event *event) { struct weston_pointer_drag *drag = container_of(grab, struct weston_pointer_drag, grab); @@ -342,7 +342,7 @@ drag_grab_motion(struct weston_pointer_grab *grab, uint32_t time, float fx, fy; wl_fixed_t sx, sy; - weston_pointer_move(pointer, x, y); + weston_pointer_move(pointer, event); if (drag->base.icon) { fx = wl_fixed_to_double(pointer->x) + drag->base.dx; |