Commit db3c824c authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Matthias Clasen

wayland: Set a null cursor surface when cursor buffer is null

If the buffer of a cursor is NULL, for example if its an empty cursor,
just set the cursor surface to NULL as well. Not doing this we'll use
uninitialized hotspot coordinates, dimensions and scales.

https://bugzilla.gnome.org/show_bug.cgi?id=758025
parent 14119f98
......@@ -217,16 +217,27 @@ gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd)
if (!wd->wl_pointer)
return retval;
wl_pointer_set_cursor (wd->wl_pointer,
wd->enter_serial,
wd->pointer_surface,
x, y);
if (buffer)
{
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
wl_surface_set_buffer_scale (wd->pointer_surface, scale);
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
wl_surface_commit (wd->pointer_surface);
wl_pointer_set_cursor (wd->wl_pointer,
wd->enter_serial,
wd->pointer_surface,
x, y);
}
else
{
wl_pointer_set_cursor (wd->wl_pointer,
wd->enter_serial,
NULL,
0, 0);
wl_surface_attach (wd->pointer_surface, NULL, 0, 0);
wl_surface_commit (wd->pointer_surface);
}
next_image_index =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment