mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
wayland: Fall back to an unthemed default cursor
In the absence of icon themes (such as in a freshly created toolbox container), we should not just fall back to "no cursor", since that makes it hard even to close the application. Fall back to an included default cursor of last resort.
This commit is contained in:
parent
7eeeb3f229
commit
e1b25eaf5a
@ -162,6 +162,8 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
int *height,
|
||||
int *scale)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
|
||||
if (gdk_cursor_get_name (cursor))
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
@ -199,10 +201,12 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkTexture *texture = gdk_cursor_get_texture (cursor);
|
||||
cairo_surface_t *surface;
|
||||
struct wl_buffer *buffer;
|
||||
|
||||
texture = gdk_cursor_get_texture (cursor);
|
||||
|
||||
from_texture:
|
||||
surface = g_hash_table_lookup (display->cursor_surface_cache, cursor);
|
||||
if (surface == NULL)
|
||||
{
|
||||
@ -241,6 +245,11 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
hotspot_x, hotspot_y,
|
||||
width, height,
|
||||
scale);
|
||||
else
|
||||
{
|
||||
texture = gdk_texture_new_from_resource ("/org/gtk/libgdk/cursor/default");
|
||||
goto from_texture;
|
||||
}
|
||||
|
||||
none:
|
||||
*hotspot_x = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user