diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 5ed3ca7e8..33398ac97 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -587,6 +587,15 @@ parent_surface_state_applied (gpointer data, meta_wayland_subsurface_parent_state_applied (subsurface); } +void +meta_wayland_surface_cache_pending_frame_callbacks (MetaWaylandSurface *surface, + MetaWaylandPendingState *pending) +{ + wl_list_insert_list (&surface->pending_frame_callback_list, + &pending->frame_callback_list); + wl_list_init (&pending->frame_callback_list); +} + void meta_wayland_surface_apply_pending_state (MetaWaylandSurface *surface, MetaWaylandPendingState *pending) @@ -708,13 +717,7 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface *surface, } else { - /* Since there is no role assigned to the surface yet, keep frame - * callbacks queued until a role is assigned and we know how - * the surface will be drawn. - */ - wl_list_insert_list (&surface->pending_frame_callback_list, - &pending->frame_callback_list); - wl_list_init (&pending->frame_callback_list); + meta_wayland_surface_cache_pending_frame_callbacks (surface, pending); if (pending->newly_attached) { diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 6fd19bf41..276a135dc 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -256,6 +256,9 @@ MetaWaylandSurface *meta_wayland_surface_get_toplevel (MetaWaylandSurface *surfa MetaWindow * meta_wayland_surface_get_toplevel_window (MetaWaylandSurface *surface); +void meta_wayland_surface_cache_pending_frame_callbacks (MetaWaylandSurface *surface, + MetaWaylandPendingState *pending); + void meta_wayland_surface_queue_pending_frame_callbacks (MetaWaylandSurface *surface); void meta_wayland_surface_queue_pending_state_frame_callbacks (MetaWaylandSurface *surface,