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:
Jasper St. Pierre 2014-04-11 23:24:05 -07:00
parent f5e77d7f63
commit d0f0be8b03

View File

@ -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);