1
0
Fork 0

backends/x11: Avoid defining (and freeing!) nonexistent cursors

Such as "default" for legacy X11 themes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3454
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 847f015017)
This commit is contained in:
Daniel van Vugt 2024-04-23 15:22:12 +08:00 committed by Jonas Ådahl
parent df93ce4524
commit c1f03eba73

View file

@ -108,11 +108,14 @@ meta_cursor_renderer_x11_update_cursor (MetaCursorRenderer *renderer,
Cursor xcursor;
xcursor = create_x_cursor (xdisplay, cursor);
XDefineCursor (xdisplay, xwindow, xcursor);
XFlush (xdisplay);
XFreeCursor (xdisplay, xcursor);
if (xcursor)
{
XDefineCursor (xdisplay, xwindow, xcursor);
XFlush (xdisplay);
XFreeCursor (xdisplay, xcursor);
has_server_cursor = TRUE;
has_server_cursor = TRUE;
}
}
}