x11: Handle callback cursors

For these cursors, get the texture for the cursor image by
calling the callback. We always use scale 1.
This commit is contained in:
Matthias Clasen
2024-03-20 21:09:09 -04:00
parent 6e3dc1e669
commit 80811069ac

View File

@@ -370,11 +370,33 @@ gdk_x11_display_get_xcursor (GdkDisplay *display,
if (gdk_cursor_get_name (cursor))
xcursor = gdk_x11_cursor_create_for_name (display, gdk_cursor_get_name (cursor));
else
else if (gdk_cursor_get_texture (cursor))
xcursor = gdk_x11_cursor_create_for_texture (display,
gdk_cursor_get_texture (cursor),
gdk_cursor_get_hotspot_x (cursor),
gdk_cursor_get_hotspot_y (cursor));
else
{
int size;
GdkTexture *texture;
int width, height;
int hotspot_x, hotspot_y;
size = XcursorGetDefaultSize (GDK_DISPLAY_XDISPLAY (display));
texture = gdk_cursor_get_texture_for_size (cursor, size, 1,
&width, &height,
&hotspot_x, &hotspot_y);
if (texture)
{
xcursor = gdk_x11_cursor_create_for_texture (display,
texture,
hotspot_x,
hotspot_y);
g_object_unref (texture);
}
}
if (xcursor != None)
{