diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index e0d2877dd..c1b084012 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -800,12 +800,22 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen, MetaRendererNative *renderer_native = egl_renderer->platform; CoglOnscreenEGL *egl_onscreen = onscreen->winsys; MetaOnscreenNative *onscreen_native = egl_onscreen->platform; + MetaBackend *backend = meta_get_backend (); + MetaMonitorManager *monitor_manager = + meta_backend_get_monitor_manager (backend); + MetaMonitorManagerKms *monitor_manager_kms = + META_MONITOR_MANAGER_KMS (monitor_manager); CoglFrameInfo *frame_info; frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos); frame_info->global_frame_counter = renderer_native->frame_counter; - g_warn_if_fail (!onscreen_native->pending_queue_swap_notify); + /* + * Wait for the flip callback before continuing, as we might have started the + * animation earlier due to the animation being driven by some other monitor. + */ + while (onscreen_native->pending_flips) + meta_monitor_manager_kms_wait_for_flip (monitor_manager_kms); parent_vtable->onscreen_swap_buffers_with_damage (onscreen, rectangles,