backends: Restore support for loading X11 cursor themes missing "default"
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3184 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
This commit is contained in:
parent
4a4ab8c533
commit
d2c6b77059
2 changed files with 13 additions and 5 deletions
|
@ -173,16 +173,18 @@ load_cursor_on_client (MetaCursor cursor,
|
|||
{
|
||||
XcursorImages *xcursor_images;
|
||||
int fallback_size, i;
|
||||
/* Set a 'default' fallback */
|
||||
MetaCursor cursors[] = { cursor, META_CURSOR_DEFAULT };
|
||||
const char *cursor_names[2];
|
||||
|
||||
if (cursor == META_CURSOR_BLANK)
|
||||
return create_blank_cursor_images ();
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (cursors); i++)
|
||||
cursor_names[0] = meta_cursor_get_name (cursor);
|
||||
cursor_names[1] = meta_cursor_get_legacy_name (cursor);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (cursor_names); i++)
|
||||
{
|
||||
xcursor_images =
|
||||
xcursor_library_load_images (meta_cursor_get_name (cursors[i]),
|
||||
xcursor_library_load_images (cursor_names[i],
|
||||
meta_prefs_get_cursor_theme (),
|
||||
meta_prefs_get_cursor_size () * scale);
|
||||
if (xcursor_images)
|
||||
|
|
|
@ -71,10 +71,16 @@ static Cursor
|
|||
create_x_cursor (Display *xdisplay,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
Cursor result;
|
||||
|
||||
if (cursor == META_CURSOR_BLANK)
|
||||
return create_blank_cursor (xdisplay);
|
||||
|
||||
return XcursorLibraryLoadCursor (xdisplay, meta_cursor_get_name (cursor));
|
||||
result = XcursorLibraryLoadCursor (xdisplay, meta_cursor_get_name (cursor));
|
||||
if (!result)
|
||||
result = XcursorLibraryLoadCursor (xdisplay, meta_cursor_get_legacy_name (cursor));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue