From 4d23e7c202f7db84c15f65555790ae46170fcc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 29 Jan 2015 15:43:01 +0800 Subject: [PATCH] wayland: Fix caching of surface state The commit 97a69cee5a12e11912b09f6617001a7da005f264 broke the caching of the surface state when because the frame_callback_list target state was overwritten after the content had been moved to it. This commit fixes it by moving the frame list addition after the copy. We also need to initialize the list since the plain copy put garbage in it. https://bugzilla.gnome.org/show_bug.cgi?id=743678 --- src/wayland/meta-wayland-surface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 68fdb82f3..10a9555a2 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -296,10 +296,11 @@ move_pending_state (MetaWaylandPendingState *from, if (from->buffer) wl_list_remove (&from->buffer_destroy_listener.link); - wl_list_insert_list (&to->frame_callback_list, &from->frame_callback_list); - *to = *from; + wl_list_init (&to->frame_callback_list); + wl_list_insert_list (&to->frame_callback_list, &from->frame_callback_list); + if (to->buffer) wl_signal_add (&to->buffer->destroy_signal, &to->buffer_destroy_listener);