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:
committed by
Alexander Larsson
parent
1da329b2bd
commit
1db87c897f
@ -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 ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user