wayland: Only set newly_attached if the buffer changes
This cleans up the check to determine if the buffer changed, meaning we shouldn't have to pass it around like we needed to do before.
This commit is contained in:
@ -150,7 +150,7 @@ commit_attached_buffer (MetaWaylandSurface *surface,
|
||||
MetaWaylandDoubleBufferedState *pending)
|
||||
{
|
||||
/* wl_surface.attach */
|
||||
if (pending->newly_attached && surface->buffer != pending->buffer)
|
||||
if (pending->newly_attached)
|
||||
{
|
||||
surface_set_buffer (surface, pending->buffer);
|
||||
return TRUE;
|
||||
@ -416,6 +416,9 @@ wl_surface_attach (struct wl_client *client,
|
||||
else
|
||||
buffer = NULL;
|
||||
|
||||
if (surface->buffer == buffer)
|
||||
return;
|
||||
|
||||
if (surface->pending.buffer)
|
||||
wl_list_remove (&surface->pending.buffer_destroy_listener.link);
|
||||
|
||||
|
Reference in New Issue
Block a user