[gnome-builder/gnome-builder-3-34] gui: freeze notify of visible-child during changes



commit e283d35428067cf1921ae85984ade51a9db73d3a
Author: Christian Hergert <chergert redhat com>
Date:   Wed Nov 6 11:03:42 2019 -0800

    gui: freeze notify of visible-child during changes

 src/libide/gui/ide-frame-wrapper.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/gui/ide-frame-wrapper.c b/src/libide/gui/ide-frame-wrapper.c
index aacd241f5..5a8556d51 100644
--- a/src/libide/gui/ide-frame-wrapper.c
+++ b/src/libide/gui/ide-frame-wrapper.c
@@ -40,24 +40,28 @@ G_DEFINE_TYPE (IdeFrameWrapper, ide_frame_wrapper, GTK_TYPE_STACK)
 
 static void
 ide_frame_wrapper_add (GtkContainer *container,
-                              GtkWidget    *widget)
+                       GtkWidget    *widget)
 {
   IdeFrameWrapper *self = (IdeFrameWrapper *)container;
 
   g_assert (IDE_IS_FRAME_WRAPPER (container));
   g_assert (GTK_IS_WIDGET (widget));
 
+  g_object_freeze_notify (G_OBJECT (self));
+
   if (gtk_widget_get_visible (widget))
     g_queue_push_head (&self->history, widget);
   else
     g_queue_push_tail (&self->history, widget);
 
   GTK_CONTAINER_CLASS (ide_frame_wrapper_parent_class)->add (container, widget);
+
+  g_object_thaw_notify (G_OBJECT (self));
 }
 
 static void
 ide_frame_wrapper_remove (GtkContainer *container,
-                                 GtkWidget    *widget)
+                          GtkWidget    *widget)
 {
   IdeFrameWrapper *self = (IdeFrameWrapper *)container;
 
@@ -69,6 +73,8 @@ ide_frame_wrapper_remove (GtkContainer *container,
    * focusing the wrong "next" widget as part of the removal.
    */
 
+  g_object_freeze_notify (G_OBJECT (self));
+
   g_queue_remove (&self->history, widget);
 
   if (self->history.length > 0)
@@ -80,11 +86,13 @@ ide_frame_wrapper_remove (GtkContainer *container,
     }
 
   GTK_CONTAINER_CLASS (ide_frame_wrapper_parent_class)->remove (container, widget);
+
+  g_object_thaw_notify (G_OBJECT (self));
 }
 
 static void
 ide_frame_wrapper_notify_visible_child (IdeFrameWrapper *self,
-                                               GParamSpec            *pspec)
+                                        GParamSpec      *pspec)
 {
   GtkWidget *visible_child;
 


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