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
This commit is contained in:
Jonas Ådahl 2015-07-10 17:01:22 +08:00
parent a70a2c3744
commit 9611661154

View File

@ -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 <stdlib.h>
@ -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