[clutter/clutter-1.20] evdev: Add clutter_evdev_warp_pointer
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.20] evdev: Add clutter_evdev_warp_pointer
- Date: Wed, 11 Jun 2014 21:21:48 +0000 (UTC)
commit 4cdcbcb2b1d339466911d523fb116719c94eb0eb
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue May 27 14:03:09 2014 -0400
evdev: Add clutter_evdev_warp_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=731536
clutter/evdev/clutter-device-manager-evdev.c | 27 ++++++++++++++++++++++++++
clutter/evdev/clutter-evdev.h | 6 +++++
2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c
index 1855438..442bf19 100644
--- a/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/evdev/clutter-device-manager-evdev.c
@@ -1984,3 +1984,30 @@ clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
tmp_list = tmp_list->next;
}
}
+
+/**
+ * clutter_evdev_warp_pointer:
+ * @pointer_device: the pointer device to warp
+ * @time: the timestamp for the warp event
+ * @x: the new X position of the pointer
+ * @y: the new Y position of the pointer
+ *
+ * Warps the pointer to a new location. Technically, this is
+ * processed the same way as an absolute motion event from
+ * libinput: it simply generates an absolute motion event that
+ * will be processed on the next iteration of the mainloop.
+ *
+ * The intended use for this is for display servers that need
+ * to warp cursor the cursor to a new location.
+ *
+ * Since: 1.20
+ * Stability: unstable
+ */
+void
+clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
+ guint32 time_,
+ int x,
+ int y)
+{
+ notify_absolute_motion (pointer_device, time_, x, y);
+}
diff --git a/clutter/evdev/clutter-evdev.h b/clutter/evdev/clutter-evdev.h
index c76cc72..d5f9deb 100644
--- a/clutter/evdev/clutter-evdev.h
+++ b/clutter/evdev/clutter-evdev.h
@@ -119,6 +119,12 @@ struct libinput_device * clutter_evdev_input_device_get_libinput_device (Clutter
CLUTTER_AVAILABLE_IN_1_20
gint32 clutter_evdev_event_sequence_get_slot (const ClutterEventSequence *sequence);
+CLUTTER_AVAILABLE_IN_1_20
+void clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
+ guint32 time_,
+ int x,
+ int y);
+
G_END_DECLS
#endif /* __CLUTTER_EVDEV_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]