From a1873e0c4f46188a427dfe2332a3638cf38abb7e Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Thu, 15 Sep 2022 16:02:08 +0800 Subject: [PATCH] core/events: Don't update the cursor renderer on motion under X11 Doing so was unnecessary and seemed to cause feedback to Xorg resulting in heavy stuttering and random freezes. We do however keep the call to `meta_cursor_tracker_invalidate_position` so as to not undo the intention of 9bdf4b35. Suggested by Carlos Garnacho. Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5861 and https://launchpad.net/bugs/1989582 Part-of: --- src/core/events.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core/events.c b/src/core/events.c index eca21f52e..aaf6f49ae 100644 --- a/src/core/events.c +++ b/src/core/events.c @@ -330,14 +330,20 @@ meta_display_handle_event (MetaDisplay *display, if (event->type == CLUTTER_MOTION) { - MetaCursorRenderer *cursor_renderer; ClutterInputDevice *device; device = clutter_event_get_device (event); - cursor_renderer = meta_backend_get_cursor_renderer_for_device (backend, - device); - if (cursor_renderer) - meta_cursor_renderer_update_position (cursor_renderer); + +#ifdef HAVE_WAYLAND + if (wayland_compositor) + { + MetaCursorRenderer *cursor_renderer = + meta_backend_get_cursor_renderer_for_device (backend, device); + + if (cursor_renderer) + meta_cursor_renderer_update_position (cursor_renderer); + } +#endif if (device == clutter_seat_get_pointer (clutter_input_device_get_seat (device))) {