diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index c68268e603..8f714d80fa 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -1033,7 +1033,7 @@ _gtk_css_style_property_init_properties (void) GTK_CSS_PROPERTY_ICON_THEME, G_TYPE_NONE, GTK_STYLE_PROPERTY_INHERIT, - GTK_CSS_AFFECTS_ICON | GTK_CSS_AFFECTS_SYMBOLIC_ICON, + GTK_CSS_AFFECTS_ICON | GTK_CSS_AFFECTS_SYMBOLIC_ICON | GTK_CSS_AFFECTS_ICON_SIZE, icon_theme_value_parse, NULL, gtk_css_icon_theme_value_new (NULL)); @@ -1592,7 +1592,7 @@ _gtk_css_style_property_init_properties (void) GTK_CSS_PROPERTY_ICON_STYLE, G_TYPE_NONE, GTK_STYLE_PROPERTY_INHERIT, - GTK_CSS_AFFECTS_ICON | GTK_CSS_AFFECTS_SYMBOLIC_ICON, + GTK_CSS_AFFECTS_ICON | GTK_CSS_AFFECTS_SYMBOLIC_ICON | GTK_CSS_AFFECTS_ICON_SIZE, icon_style_parse, NULL, _gtk_css_icon_style_value_new (GTK_CSS_ICON_STYLE_REQUESTED)); diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h index 1e431729e4..a173f55d13 100644 --- a/gtk/gtkcsstypesprivate.h +++ b/gtk/gtkcsstypesprivate.h @@ -127,6 +127,7 @@ typedef enum { GTK_CSS_AFFECTS_CONTENT = (1 << 0), GTK_CSS_AFFECTS_BACKGROUND = (1 << 1), GTK_CSS_AFFECTS_BORDER = (1 << 2), + GTK_CSS_AFFECTS_ICON_SIZE = (1 << 3), GTK_CSS_AFFECTS_TEXT_ATTRS = (1 << 4), GTK_CSS_AFFECTS_TEXT_SIZE = (1 << 5), GTK_CSS_AFFECTS_TEXT_CLIP = (1 << 6), diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index 5fe768995b..484c022ace 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -60,7 +60,20 @@ gtk_icon_helper_invalidate_for_change (GtkIconHelper *self, (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_ICON) && !self->rendered_surface_is_symbolic))) { - gtk_icon_helper_invalidate (self); + /* Avoid the queue_resize in gtk_icon_helper_invalidate */ + g_clear_object (&self->texture); + + if (self->rendered_surface != NULL) + { + cairo_surface_destroy (self->rendered_surface); + self->rendered_surface = NULL; + self->rendered_surface_is_symbolic = FALSE; + } + + if (change == NULL || + (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_ICON_SIZE) && + !GTK_IS_CSS_TRANSIENT_NODE (self->node))) + gtk_widget_queue_resize (self->owner); } }