[gtk] widget: Query CSS values later in size_allocate



commit eebb8497605f9981a7232879d9f31805dfffa970
Author: Timm Bäder <mail baedert org>
Date:   Tue Nov 27 06:00:30 2018 +0100

    widget: Query CSS values later in size_allocate
    
    Move it below the "this widget only changed its position" check.

 gtk/gtkwidget.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a05bc068cc..755b7fea2c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4128,11 +4128,6 @@ gtk_widget_size_allocate (GtkWidget           *widget,
   priv->allocated_size = *allocation;
   priv->allocated_size_baseline = baseline;
 
-  style = gtk_css_node_get_style (priv->cssnode);
-  get_box_margin (style, &margin);
-  get_box_border (style, &border);
-  get_box_padding (style, &padding);
-
   adjusted_allocation = real_allocation;
   if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
     {
@@ -4245,6 +4240,11 @@ gtk_widget_size_allocate (GtkWidget           *widget,
       goto check_clip;
     }
 
+  style = gtk_css_node_get_style (priv->cssnode);
+  get_box_margin (style, &margin);
+  get_box_border (style, &border);
+  get_box_padding (style, &padding);
+
   /* Since gtk_widget_measure does it for us, we can be sure here that
    * the given alloaction is large enough for the css margin/bordder/padding */
   real_allocation.x = 0;


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