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:
Rob Bradford 2012-01-05 16:32:09 +00:00
parent f1995f80e7
commit ff016a7857

View File

@ -139,14 +139,20 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
int x, y;
if (cursor)
g_object_ref (cursor);
/* Setting the cursor to NULL means that we should use the default cursor */
if (!cursor)
{
buffer = _gdk_wayland_cursor_get_buffer(cursor, &x, &y);
wl_input_device_attach(wd->device, wd->time, buffer, x, y);
}
else
{
wl_input_device_attach(wd->device, wd->time, NULL, 0, 0);
/* 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);
wl_input_device_attach(wd->device, wd->time, buffer, x, y);
g_object_unref (cursor);
}
static void