Avoid emitting ::style-set by name

GtkStyle is deprecated, but we still emit ::style-set quite
a bit, so lets at least not be slow while doing it.
This commit is contained in:
Matthias Clasen 2016-05-06 10:12:14 -04:00
parent 12dfb368e2
commit 0f116135f4
2 changed files with 3 additions and 4 deletions

View File

@ -4154,8 +4154,6 @@ gtk_widget_ensure_style (GtkWidget *widget)
{
g_object_unref (style);
_gtk_widget_set_style (widget, NULL);
g_signal_emit_by_name (widget, "style-set", 0, NULL);
}
}

View File

@ -5439,9 +5439,9 @@ gtk_widget_realize (GtkWidget *widget)
if (priv->parent && !_gtk_widget_get_realized (priv->parent))
gtk_widget_realize (priv->parent);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_ensure_style (widget);
G_GNUC_END_IGNORE_DEPRECATIONS;
G_GNUC_END_IGNORE_DEPRECATIONS
if (priv->style_update_pending)
g_signal_emit (widget, widget_signals[STYLE_UPDATED], 0);
@ -16599,6 +16599,7 @@ void
_gtk_widget_set_style (GtkWidget *widget,
GtkStyle *style)
{
g_signal_emit (widget, widget_signals[STYLE_SET], 0, widget->priv->style);
widget->priv->style = style;
}