summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2022-06-09 15:37:19 +0200
committerMarge Bot <marge-bot@gnome.org>2023-03-01 23:57:32 +0000
commitcc2bbb25ba19c38d29320d0e8cae575fe2f5c609 (patch)
tree4a93ee9a84d84405e85afdc0deb1316f531c9aab
parent9752ddf2cfc5e5d9b68c5a9f45f961994ac66fbf (diff)
downloadmutter-cc2bbb25ba19c38d29320d0e8cae575fe2f5c609.tar.gz
frame-clock: Don't delay schedule_now() if already scheduled
If we call schedule(), which will schedule an update some time in the future, and then schedule_now(), we should reschedule the frame clock to update immediately, and not some time in the future. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2854>
-rw-r--r--clutter/clutter/clutter-frame-clock.c3
-rw-r--r--src/tests/clutter/conform/frame-clock.c1
2 files changed, 2 insertions, 2 deletions
diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c
index e4d0fb98a..fccc55aca 100644
--- a/clutter/clutter/clutter-frame-clock.c
+++ b/clutter/clutter/clutter-frame-clock.c
@@ -632,10 +632,9 @@ clutter_frame_clock_schedule_update_now (ClutterFrameClock *frame_clock)
{
case CLUTTER_FRAME_CLOCK_STATE_INIT:
case CLUTTER_FRAME_CLOCK_STATE_IDLE:
+ case CLUTTER_FRAME_CLOCK_STATE_SCHEDULED:
next_update_time_us = g_get_monotonic_time ();
break;
- case CLUTTER_FRAME_CLOCK_STATE_SCHEDULED:
- return;
case CLUTTER_FRAME_CLOCK_STATE_DISPATCHING:
case CLUTTER_FRAME_CLOCK_STATE_PENDING_PRESENTED:
frame_clock->pending_reschedule = TRUE;
diff --git a/src/tests/clutter/conform/frame-clock.c b/src/tests/clutter/conform/frame-clock.c
index e5b58f182..d82c70799 100644
--- a/src/tests/clutter/conform/frame-clock.c
+++ b/src/tests/clutter/conform/frame-clock.c
@@ -430,6 +430,7 @@ schedule_update_now_hw_callback (gpointer user_data)
UpdateNowFrameClockTest *test = user_data;
ClutterFrameClock *frame_clock = test->base.fake_hw_clock->frame_clock;
+ clutter_frame_clock_schedule_update (frame_clock);
clutter_frame_clock_schedule_update_now (frame_clock);
g_assert (!test->idle_source_id);
test->idle_source_id = g_idle_add (assert_not_reached_idle, NULL);