]> Pileus Git - ~andy/gtk/commitdiff
label: Don't create the layout in size_allocate() if not needed
authorBenjamin Otte <otte@redhat.com>
Tue, 29 Mar 2011 11:24:34 +0000 (13:24 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 29 Mar 2011 13:33:27 +0000 (15:33 +0200)
Just update its size if it already exists.

gtk/gtklabel.c

index 7431b0f7900f6c5c1d7f3112e319e81b26c0caf4..ebf443159c73d046371a8c17061f13a04b9686af 100644 (file)
@@ -3803,13 +3803,8 @@ gtk_label_size_allocate (GtkWidget     *widget,
 
   GTK_WIDGET_CLASS (gtk_label_parent_class)->size_allocate (widget, allocation);
 
-  /* The layout may have been recently cleared in get_size_for_orientation(),
-   * but the width at that point may not be the same as the allocated width
-   */
-  if (priv->wrap)
-    gtk_label_clear_layout (label);
-
-  gtk_label_ensure_layout (label);
+  if (priv->layout)
+    gtk_label_update_layout_width (label);
 
   if (priv->select_info && priv->select_info->window)
     {