summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-05-27 14:03:09 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2014-06-11 17:21:15 -0400
commit4cdcbcb2b1d339466911d523fb116719c94eb0eb (patch)
tree823fda3dbfd13af62c55ef674abd57887f245ce8
parent31749cfa47babaf3a76292a40fabb768852dcc96 (diff)
downloadclutter-4cdcbcb2b1d339466911d523fb116719c94eb0eb.tar.gz
evdev: Add clutter_evdev_warp_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=731536
-rw-r--r--clutter/evdev/clutter-device-manager-evdev.c27
-rw-r--r--clutter/evdev/clutter-evdev.h6
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 1855438af..442bf19c9 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 c76cc7210..d5f9deb3c 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__ */