gtk_init(): initialise the GDK global GPeriodic

Initialise the GDK global periodic clock object from gtk_init() if
nobody installed one before us.
This commit is contained in:
Ryan Lortie
2010-10-20 13:46:37 +02:00
parent 76db970f8e
commit 079366259a
2 changed files with 6 additions and 0 deletions

View File

@@ -823,6 +823,9 @@ gdk_enable_multidevice (void)
* you should check with gdk_threads_get_periodic() to ensure that it is
* %NULL before attempting to call this function.
*
* gtk_init() will set the default clock if it has not already been set,
* so you need to call this function before you call gtk_init().
*
* Since: 3.0
**/
void

View File

@@ -1068,6 +1068,9 @@ gtk_init_check (int *argc,
if (!gtk_parse_args (argc, argv))
return FALSE;
if (gdk_threads_get_periodic () == NULL)
gdk_threads_set_periodic (g_periodic_new (60, GDK_PRIORITY_REDRAW));
return gdk_display_open_default_libgtk_only () != NULL;
}