diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c index 86494bd09..e4a4302f8 100644 --- a/clutter/clutter/clutter-frame-clock.c +++ b/clutter/clutter/clutter-frame-clock.c @@ -349,9 +349,10 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock, swap_to_flip_us); frame_clock->shortterm_max_update_duration_us = - MAX (frame_clock->shortterm_max_update_duration_us, - frame_clock->last_dispatch_lateness_us + dispatch_to_swap_us + - MAX (swap_to_rendering_done_us, swap_to_flip_us)); + CLAMP (frame_clock->last_dispatch_lateness_us + dispatch_to_swap_us + + MAX (swap_to_rendering_done_us, swap_to_flip_us), + frame_clock->shortterm_max_update_duration_us, + frame_clock->refresh_interval_us); maybe_update_longterm_max_duration_us (frame_clock, frame_info);