From 4cdcbcb2b1d339466911d523fb116719c94eb0eb Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 27 May 2014 14:03:09 -0400 Subject: [PATCH] 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(+) 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__ */