diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-02-02 15:51:47 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-02-03 12:06:58 +0100 |
commit | c655759cefa56efdb0cb943bb5dada3ff75a963c (patch) | |
tree | ef945ea7131b6419d00828fa8661d86691563d83 /gdk/gdkframeclockidle.c | |
parent | 334acbfc39cc08869932ec046e4d13e6c4b64be6 (diff) | |
download | gtk+-c655759cefa56efdb0cb943bb5dada3ff75a963c.tar.gz |
Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.
The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.
Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.
https://bugzilla.gnome.org/show_bug.cgi?id=793124
Diffstat (limited to 'gdk/gdkframeclockidle.c')
-rw-r--r-- | gdk/gdkframeclockidle.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdk/gdkframeclockidle.c b/gdk/gdkframeclockidle.c index 371450278d..ebb7efe713 100644 --- a/gdk/gdkframeclockidle.c +++ b/gdk/gdkframeclockidle.c @@ -237,22 +237,22 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle) if (priv->flush_idle_id == 0 && RUN_FLUSH_IDLE (priv)) { - priv->flush_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_EVENTS + 1, - min_interval, - gdk_frame_clock_flush_idle, - g_object_ref (clock_idle), - (GDestroyNotify) g_object_unref); + priv->flush_idle_id = g_timeout_add_full (GDK_PRIORITY_EVENTS + 1, + min_interval, + gdk_frame_clock_flush_idle, + g_object_ref (clock_idle), + (GDestroyNotify) g_object_unref); g_source_set_name_by_id (priv->flush_idle_id, "[gtk+] gdk_frame_clock_flush_idle"); } if (!priv->in_paint_idle && priv->paint_idle_id == 0 && RUN_PAINT_IDLE (priv)) { - priv->paint_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_REDRAW, - min_interval, - gdk_frame_clock_paint_idle, - g_object_ref (clock_idle), - (GDestroyNotify) g_object_unref); + priv->paint_idle_id = g_timeout_add_full (GDK_PRIORITY_REDRAW, + min_interval, + gdk_frame_clock_paint_idle, + g_object_ref (clock_idle), + (GDestroyNotify) g_object_unref); g_source_set_name_by_id (priv->paint_idle_id, "[gtk+] gdk_frame_clock_paint_idle"); } } @@ -364,7 +364,7 @@ gdk_frame_clock_paint_idle (void *data) /* We are likely not getting precisely even callbacks in real * time, particularly if the event loop is busy. * This is a documented limitation in the precision of - * gdk_threads_add_timeout_full and g_timeout_add_full. + * g_timeout_add_full(). * * In order to avoid this imprecision from compounding between * frames and affecting visual smoothness, we correct frame_time |