From 961166115461e84a6ec31782535585369ff528cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 10 Jul 2015 17:01:22 +0800 Subject: [PATCH] native: Don't wait for a new input event to wrap the pointer If we rely on getting back an input event with the warped pointer coordinates, we might draw a frame with the old coordinates if we warp during the paint phase. Avoid that by moving the cursor immediately. https://bugzilla.gnome.org/show_bug.cgi?id=744104 --- src/backends/native/meta-backend-native.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index 768b96b8a..454eec655 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -36,6 +36,7 @@ #include "meta-monitor-manager-kms.h" #include "meta-cursor-renderer-native.h" #include "meta-launcher.h" +#include "backends/meta-cursor-tracker-private.h" #include "backends/meta-pointer-constraint.h" #include @@ -279,11 +280,16 @@ meta_backend_native_warp_pointer (MetaBackend *backend, { ClutterDeviceManager *manager = clutter_device_manager_get_default (); ClutterInputDevice *device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE); + MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL); /* XXX */ guint32 time_ = 0; + /* Warp the input device pointer state. */ clutter_evdev_warp_pointer (device, time_, x, y); + + /* Warp displayed pointer cursor. */ + meta_cursor_tracker_update_position (tracker, x, y); } static void