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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user