wayland: Set a default cursor when the window cursor is set to NULL
This change follows on from a change in semantics in Wayland where calling wl_input_device_attach with nil would make the compositor set the pointer sprite to it's default cursor sprite.
This commit is contained in:
@ -139,14 +139,20 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
|
|||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (cursor)
|
if (cursor)
|
||||||
|
g_object_ref (cursor);
|
||||||
|
|
||||||
|
/* Setting the cursor to NULL means that we should use the default cursor */
|
||||||
|
if (!cursor)
|
||||||
{
|
{
|
||||||
|
/* FIXME: Is this the best sensible default ? */
|
||||||
|
cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
|
||||||
|
GDK_LEFT_PTR);
|
||||||
|
}
|
||||||
|
|
||||||
buffer = _gdk_wayland_cursor_get_buffer(cursor, &x, &y);
|
buffer = _gdk_wayland_cursor_get_buffer(cursor, &x, &y);
|
||||||
wl_input_device_attach(wd->device, wd->time, buffer, x, y);
|
wl_input_device_attach(wd->device, wd->time, buffer, x, y);
|
||||||
}
|
|
||||||
else
|
g_object_unref (cursor);
|
||||||
{
|
|
||||||
wl_input_device_attach(wd->device, wd->time, NULL, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user