From f1690a9a375f19c10341d4fab7f6b358bd0ba96f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 14 Mar 2024 21:45:19 -0400 Subject: [PATCH] wayland: Keep cursor types limping along Cursor themes have recently started to reduce their coverage of 'legacy' cursor names, and reduced to the standard names. Support this for the few cursor types that are still used in GTK. --- gdk/wayland/gdkcursor-wayland.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c index 3b13ed8736..b04b9313af 100644 --- a/gdk/wayland/gdkcursor-wayland.c +++ b/gdk/wayland/gdkcursor-wayland.c @@ -423,6 +423,36 @@ _gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display, g_free (cursor_name); + if (!result) + { + const char *name = NULL; + + /* Map cursors back to standard names. + * Currently, we just list the cursor values + * that are used in GTK. More can be added. + */ + switch ((int)cursor_type) + { + case GDK_XTERM: + name = "text"; + break; + case GDK_FLEUR: + name = "move"; + break; + case GDK_CROSSHAIR: + name = "cross"; + break; + default: + name = "default"; + break; + } + + if (name) + result = _gdk_wayland_display_get_cursor_for_name_with_scale (display, + name, + scale); + } + return result; }