[gnome-builder] object: never notify immediately in notify_in_main()



commit da260657dc38c5f7ea9cf020e373a079ce16f048
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 24 18:54:46 2018 -0800

    object: never notify immediately in notify_in_main()
    
    We have various code that relies on this returning to the main loop before
    emitting the notify signal. So actually guarantee that is the case.

 src/libide/ide-object.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/libide/ide-object.c b/src/libide/ide-object.c
index 7ee7e591d..6385546d1 100644
--- a/src/libide/ide-object.c
+++ b/src/libide/ide-object.c
@@ -745,6 +745,9 @@ ide_object_notify_in_main_cb (gpointer data)
  * You may want to do this when modifying state from a thread, but only
  * notify from the Gtk+ thread.
  *
+ * This will *always* return to the default main context, and never
+ * emit ::notify immediately.
+ *
  * Since: 3.18
  */
 void
@@ -759,16 +762,6 @@ ide_object_notify_in_main (gpointer    instance,
   g_return_if_fail (G_IS_OBJECT (instance));
   g_return_if_fail (pspec != NULL);
 
-  /*
-   * Short circuit if we can notify immediately without the round trip
-   * to the main loop.
-   */
-  if G_LIKELY (g_main_context_get_thread_default () == g_main_context_default ())
-    {
-      g_object_notify_by_pspec (instance, pspec);
-      return;
-    }
-
   notify = g_slice_alloc0 (sizeof *notify);
   notify->object = g_object_ref (instance);
   notify->pspec = g_param_spec_ref (pspec);


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