[clutter] evdev: Pass a motion delta to pointer constrain callback
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] evdev: Pass a motion delta to pointer constrain callback
- Date: Tue, 16 Feb 2016 11:01:41 +0000 (UTC)
commit 8181ef15d6d203e82de9f2f10827563515612c2a
Author: Jonas Ådahl <jadahl gmail com>
Date: Tue Jul 7 10:23:12 2015 +0800
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
README.in | 7 +++++++
clutter/evdev/clutter-device-manager-evdev.c | 5 ++++-
clutter/evdev/clutter-evdev.h | 2 ++
3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/README.in b/README.in
index 5eb8e0d..65fd6cc 100644
--- a/README.in
+++ b/README.in
@@ -289,6 +289,13 @@ Relevant information for developers with existing Clutter applications
wanting to port to newer releases (see NEWS for general information on new
features).
+Release Notes for Clutter 1.26
+-------------------------------------------------------------------------------
+
+• The evdev backend specific ClutterPointerConstrainCallback type was changed
+ to include not only the target position but also the previous position. This
+ is an API change, and will require a version check in any caller code.
+
Release Notes for Clutter 1.24
-------------------------------------------------------------------------------
diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c
index 53aa848..df9cd19 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 dca093d..be8748f 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]