diff options
-rw-r--r-- | gtk/gtkwidget.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 2d9fd7fb4c..ba85df6a71 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8112,30 +8112,22 @@ gtk_widget_real_style_updated (GtkWidget *widget) { GtkWidgetPrivate *priv = widget->priv; - gtk_widget_update_pango_context (widget); gtk_widget_update_alpha (widget); - G_GNUC_BEGIN_IGNORE_DEPRECATIONS; - if (priv->style != NULL && - priv->style != gtk_widget_get_default_style ()) - { - /* Trigger ::style-set for old - * widgets not listening to this - */ - g_signal_emit (widget, - widget_signals[STYLE_SET], - 0, - widget->priv->style); - } - G_GNUC_END_IGNORE_DEPRECATIONS; - if (widget->priv->context) { GtkCssStyleChange *change = gtk_style_context_get_change (widget->priv->context); + gboolean has_text = gtk_widget_peek_pango_context (widget) != NULL; + + if (change == NULL || + (has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_FONT))) + gtk_widget_update_pango_context (widget); if (widget->priv->anchored) { - if (change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE)) + if (change == NULL || + gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE) || + (has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT))) gtk_widget_queue_resize (widget); else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_CLIP)) gtk_widget_queue_allocate (widget); @@ -8145,9 +8137,26 @@ gtk_widget_real_style_updated (GtkWidget *widget) } else { + gtk_widget_update_pango_context (widget); + if (widget->priv->anchored) gtk_widget_queue_resize (widget); } + + G_GNUC_BEGIN_IGNORE_DEPRECATIONS; + if (priv->style != NULL && + priv->style != gtk_widget_get_default_style ()) + { + /* Trigger ::style-set for old + * widgets not listening to this + */ + g_signal_emit (widget, + widget_signals[STYLE_SET], + 0, + widget->priv->style); + } + G_GNUC_END_IGNORE_DEPRECATIONS; + } static gboolean |