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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2625>
This commit is contained in:
Daniel van Vugt 2022-09-15 16:02:08 +08:00 committed by Marge Bot
parent da04ae4ca5
commit a1873e0c4f

View File

@ -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)))
{