wayland: Fix caching of surface state

The commit 97a69cee5a 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
This commit is contained in:
Jonas Ådahl 2015-01-29 15:43:01 +08:00
parent ad90b7dd2f
commit 4d23e7c202

View File

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