wayland-surface: Properly allow setting the cursor to a NULL buffer
This commit is contained in:
parent
57866fb267
commit
4780f74a40
@ -68,7 +68,11 @@ meta_wayland_seat_update_sprite (MetaWaylandSeat *seat)
|
|||||||
if (seat->cursor_tracker == NULL)
|
if (seat->cursor_tracker == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (seat->sprite->buffer_ref.buffer)
|
||||||
buffer = seat->sprite->buffer_ref.buffer->resource;
|
buffer = seat->sprite->buffer_ref.buffer->resource;
|
||||||
|
else
|
||||||
|
buffer = NULL;
|
||||||
|
|
||||||
meta_cursor_tracker_set_window_cursor (seat->cursor_tracker,
|
meta_cursor_tracker_set_window_cursor (seat->cursor_tracker,
|
||||||
buffer,
|
buffer,
|
||||||
seat->hotspot_x,
|
seat->hotspot_x,
|
||||||
|
@ -243,6 +243,9 @@ ensure_buffer_texture (MetaWaylandBuffer *buffer)
|
|||||||
CoglError *catch_error = NULL;
|
CoglError *catch_error = NULL;
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
|
|
||||||
|
if (!buffer)
|
||||||
|
return;
|
||||||
|
|
||||||
texture = COGL_TEXTURE (cogl_wayland_texture_2d_new_from_buffer (ctx,
|
texture = COGL_TEXTURE (cogl_wayland_texture_2d_new_from_buffer (ctx,
|
||||||
buffer->resource,
|
buffer->resource,
|
||||||
&catch_error));
|
&catch_error));
|
||||||
@ -277,15 +280,12 @@ meta_wayland_surface_commit (struct wl_client *client,
|
|||||||
{
|
{
|
||||||
MetaWaylandBuffer *buffer = surface->pending.buffer;
|
MetaWaylandBuffer *buffer = surface->pending.buffer;
|
||||||
|
|
||||||
if (buffer)
|
|
||||||
{
|
|
||||||
/* Note: we set this before informing any window-actor since the
|
/* Note: we set this before informing any window-actor since the
|
||||||
* window actor will expect to find the new buffer within the
|
* window actor will expect to find the new buffer within the
|
||||||
* surface. */
|
* surface. */
|
||||||
ensure_buffer_texture (buffer);
|
ensure_buffer_texture (buffer);
|
||||||
meta_wayland_buffer_reference (&surface->buffer_ref, buffer);
|
meta_wayland_buffer_reference (&surface->buffer_ref, buffer);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (surface == compositor->seat->sprite)
|
if (surface == compositor->seat->sprite)
|
||||||
meta_wayland_seat_update_sprite (compositor->seat);
|
meta_wayland_seat_update_sprite (compositor->seat);
|
||||||
|
Loading…
Reference in New Issue
Block a user