1
0
Fork 0

clutter/frame-clock: Fix handling of equal next_presentation_time_us

This can happen with the native backend if the previous frame clock
dispatch didn't result in any KMS update, e.g. because it was triggered
by an input event, but the HW cursor didn't need updating on the stage
view. (This is likely to happen on some out of multiple stage views,
but might be possible even with a single stage view if the cursor isn't
visible)

We would previously delay next_presentation_time_us by one refresh
interval in this case, which could result in spuriously leaving one
refresh cycle unused.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2498>
This commit is contained in:
Michel Dänzer 2022-07-07 18:22:33 +02:00 committed by Marge Bot
parent b9fc741660
commit 1f7527bbc4

View file

@ -527,6 +527,7 @@ calculate_next_update_time_us (ClutterFrameClock *frame_clock,
time_since_last_next_presentation_time_us =
next_presentation_time_us - last_next_presentation_time_us;
if (frame_clock->is_next_presentation_time_valid &&
time_since_last_next_presentation_time_us > 0 &&
time_since_last_next_presentation_time_us < (refresh_interval_us / 2))
{
next_presentation_time_us =