Add gdk_frame_clock_begin/end_updating()

Add an API to start or stop continually updating the frame clock.
This is a slight convenience for applcations and avoids the problem
of getting one more frame run after an animation stops, but the
primary motivation for this is because it looks like we might have
to use timeBeginPeriod()/timeEndPeriod() on Windows to get reasonably
accurate timing, and for that we'll need to know if there is an
animation running.

https://bugzilla.gnome.org/show_bug.cgi?id=693934
This commit is contained in:
Owen W. Taylor
2013-02-15 17:04:39 -05:00
committed by Alexander Larsson
parent 1da329b2bd
commit 1db87c897f
8 changed files with 133 additions and 43 deletions

View File

@ -350,8 +350,6 @@ on_update (GdkFrameClock *frame_clock,
gtk_widget_queue_draw (window);
}
gdk_frame_clock_request_phase (frame_clock, GDK_FRAME_CLOCK_PHASE_UPDATE);
}
static GOptionEntry options[] = {
@ -393,7 +391,7 @@ main(int argc, char **argv)
frame_clock = gtk_widget_get_frame_clock (window);
g_signal_connect (frame_clock, "update",
G_CALLBACK (on_update), NULL);
gdk_frame_clock_request_phase (frame_clock, GDK_FRAME_CLOCK_PHASE_UPDATE);
gdk_frame_clock_begin_updating (frame_clock);
gtk_main ();