From d0f0be8b033e02d1d3ac1eec77a1aeca09a32eec Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 11 Apr 2014 23:24:05 -0700 Subject: [PATCH] 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. --- src/wayland/meta-wayland-surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 25c4f3286..328a18f8f 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -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);