[gtksourceview/wip/chergert/gsv-gtk4: 90/131] threads: use g_idle_add_full() or g_timeout_add_full()



commit e7152b0b0d41fe01717e1c0d79ff27de67e0e323
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 15 14:01:36 2020 -0800

    threads: use g_idle_add_full() or g_timeout_add_full()
    
    gdk_threads_* is no longer available, so use the equivalent from GLib.

 .../completion-providers/words/gtksourcecompletionwords.c     |  3 +--
 gtksourceview/gtksourcebuffer.c                               | 10 +++++-----
 gtksourceview/gtksourcecontextengine.c                        | 11 ++++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c 
b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
index 32b04e46..2cf8dc4d 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
@@ -268,8 +268,7 @@ gtk_source_completion_words_populate (GtkSourceCompletionProvider *provider,
        if (add_in_idle (words))
        {
                gtk_source_completion_words_library_lock (priv->library);
-               priv->idle_id = gdk_threads_add_idle ((GSourceFunc)add_in_idle,
-                                                            words);
+               priv->idle_id = g_idle_add ((GSourceFunc)add_in_idle, words);
        }
 }
 
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index 332bd74e..b8db21f2 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -961,11 +961,11 @@ queue_bracket_highlighting_update (GtkSourceBuffer *buffer)
         * ::update() or ::after-paint() to synchronize this.
         */
        priv->bracket_highlighting_timeout_id =
-               gdk_threads_add_timeout_full (G_PRIORITY_LOW,
-                                             UPDATE_BRACKET_DELAY,
-                                             bracket_highlighting_timeout_cb,
-                                             buffer,
-                                             NULL);
+               g_timeout_add_full (G_PRIORITY_LOW,
+                                   UPDATE_BRACKET_DELAY,
+                                   bracket_highlighting_timeout_cb,
+                                   buffer,
+                                   NULL);
 }
 
 /* Although this function is not really useful
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index dc1bf174..b086e484 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -2391,8 +2391,9 @@ install_idle_worker (GtkSourceContextEngine *ce)
 {
        if (ce->first_update == 0 && ce->incremental_update == 0)
                ce->incremental_update =
-                       gdk_threads_add_idle_full (INCREMENTAL_UPDATE_PRIORITY,
-                                                  (GSourceFunc) idle_worker, ce, NULL);
+                       g_idle_add_full (INCREMENTAL_UPDATE_PRIORITY,
+                                        (GSourceFunc) idle_worker,
+                                        ce, NULL);
 }
 
 /**
@@ -2414,9 +2415,9 @@ install_first_update (GtkSourceContextEngine *ce)
                }
 
                ce->first_update =
-                       gdk_threads_add_idle_full (FIRST_UPDATE_PRIORITY,
-                                                  (GSourceFunc) first_update_callback,
-                                                  ce, NULL);
+                       g_idle_add_full (FIRST_UPDATE_PRIORITY,
+                                        (GSourceFunc) first_update_callback,
+                                        ce, NULL);
        }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]