diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c index 80ed474a9..973272f9c 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/clutter/cogl/clutter-stage-cogl.c @@ -77,6 +77,10 @@ enum PROP_LAST }; +static void +clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window, + gint sync_delay); + static void clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window) { @@ -122,6 +126,16 @@ _clutter_stage_cogl_presented (ClutterStageCogl *stage_cogl, } _clutter_stage_presented (stage_cogl->wrapper, frame_event, frame_info); + + if (frame_event == COGL_FRAME_EVENT_COMPLETE && + stage_cogl->update_time != -1) + { + ClutterStageWindow *stage_window = CLUTTER_STAGE_WINDOW (stage_cogl); + + stage_cogl->update_time = -1; + clutter_stage_cogl_schedule_update (stage_window, + stage_cogl->last_sync_delay); + } } static gboolean @@ -159,6 +173,8 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window, if (stage_cogl->update_time != -1) return; + stage_cogl->last_sync_delay = sync_delay; + now = g_get_monotonic_time (); if (sync_delay < 0) diff --git a/clutter/clutter/cogl/clutter-stage-cogl.h b/clutter/clutter/cogl/clutter-stage-cogl.h index 17958cd24..aead9785e 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.h +++ b/clutter/clutter/cogl/clutter-stage-cogl.h @@ -59,6 +59,8 @@ struct _ClutterStageCogl * junk frames to start with. */ unsigned int frame_count; + gint last_sync_delay; + cairo_rectangle_int_t bounding_redraw_clip; guint initialized_redraw_clip : 1;