[gtk/bin-removal: 37/50] frame: Don't queue a resize if xalign changes



commit 2dd8d3d4baa22d103d536c61565d04f4b67d8482
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 3 11:39:58 2020 -0400

    frame: Don't queue a resize if xalign changes
    
    We only need to allocate children in this case.
    While we touch it, rewrite the setter to modern
    style.

 gtk/gtkframe.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index bf332de27a..61b6ade71d 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -452,16 +452,12 @@ gtk_frame_set_label_align (GtkFrame *frame,
   g_return_if_fail (GTK_IS_FRAME (frame));
 
   xalign = CLAMP (xalign, 0.0, 1.0);
+  if (priv->label_xalign == xalign)
+    return;
 
-  g_object_freeze_notify (G_OBJECT (frame));
-  if (xalign != priv->label_xalign)
-    {
-      priv->label_xalign = xalign;
-      g_object_notify_by_pspec (G_OBJECT (frame), frame_props[PROP_LABEL_XALIGN]);
-    }
-
-  g_object_thaw_notify (G_OBJECT (frame));
-  gtk_widget_queue_resize (GTK_WIDGET (frame));
+  priv->label_xalign = xalign;
+  g_object_notify_by_pspec (G_OBJECT (frame), frame_props[PROP_LABEL_XALIGN]);
+  gtk_widget_queue_allocate (GTK_WIDGET (frame));
 }
 
 /**


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