summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-07-07 10:23:12 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-02-16 18:53:58 +0800
commit8181ef15d6d203e82de9f2f10827563515612c2a (patch)
tree9c7993fb4924230413f7ed5d0d7d030f0d2fa652 /clutter
parent52e38d1ab7c0e13aee8bdd7695741faf2dbb12ef (diff)
downloadclutter-8181ef15d6d203e82de9f2f10827563515612c2a.tar.gz
evdev: Pass a motion delta to pointer constrain callback
The constrain callback cannot rely on the pointer position of the corresponding ClutterInputDevice to get the actual delta of the motion event that is to be constrained since it is only updated when an event is dispatched. So change the API to pass the previous pointer position when constraining. https://bugzilla.gnome.org/show_bug.cgi?id=752752
Diffstat (limited to 'clutter')
-rw-r--r--clutter/evdev/clutter-device-manager-evdev.c5
-rw-r--r--clutter/evdev/clutter-evdev.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c
index 53aa8480d..df9cd19b4 100644
--- a/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/evdev/clutter-device-manager-evdev.c
@@ -452,7 +452,10 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
if (manager_evdev->priv->constrain_callback)
{
manager_evdev->priv->constrain_callback (seat->core_pointer,
- us2ms (time_us), &x, &y,
+ us2ms (time_us),
+ seat->pointer_x,
+ seat->pointer_y,
+ &x, &y,
manager_evdev->priv->constrain_data);
}
else
diff --git a/clutter/evdev/clutter-evdev.h b/clutter/evdev/clutter-evdev.h
index dca093d5a..be8748f96 100644
--- a/clutter/evdev/clutter-evdev.h
+++ b/clutter/evdev/clutter-evdev.h
@@ -82,6 +82,8 @@ void clutter_evdev_reclaim_devices (void);
*/
typedef void (*ClutterPointerConstrainCallback) (ClutterInputDevice *device,
guint32 time,
+ float prev_x,
+ float prev_y,
float *x,
float *y,
gpointer user_data);