gtkwindow: Optimize GtkStyleContext usage

This commit is contained in:
Jasper St. Pierre 2014-11-25 11:05:36 -08:00
parent 90f94de615
commit 2cd835c076

View File

@ -6431,13 +6431,14 @@ get_shadow_width (GtkWidget *widget,
else
s = state | GTK_STATE_FLAG_BACKDROP;
gtk_style_context_set_state (context, s);
/* Always sum border + padding */
gtk_style_context_get_border (context, s, &border);
gtk_style_context_get_padding (context, s, &d);
sum_borders (&d, &border);
/* Calculate the size of the drop shadows ... */
gtk_style_context_set_state (context, s);
shadows = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BOX_SHADOW);
_gtk_css_shadows_value_get_extents (shadows, &border);