st/widget: Emit "style-changed" on all theme changes

Since now the resource consumption of the "style-changed" signal
handlers should be significantly lower, we can start emitting the signal
in all cases again as it was originally intended. This fixes some small
visual issues, like the battery percentage in the panel only being shown
on hover or updating the size of StIcons on scale-factor changes.

This effectively reverts f74c07b9ac

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1708

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2099>
This commit is contained in:
Jonas Dreßler 2019-11-18 00:44:36 +01:00 committed by Marge Bot
parent 172a8febe7
commit ba547ec1db

View File

@ -1740,29 +1740,7 @@ st_widget_recompute_style (StWidget *widget,
st_theme_node_paint_state_invalidate (current_paint_state (widget)); st_theme_node_paint_state_invalidate (current_paint_state (widget));
} }
/* It is very likely that custom CSS properties are used with StDrawingArea g_signal_emit (widget, signals[STYLE_CHANGED], 0);
to control the custom drawing, so never omit the ::style-changed signal */
if (paint_equal)
paint_equal = !ST_IS_DRAWING_AREA (widget);
if (paint_equal && old_theme_node->font_desc != NULL)
paint_equal = pango_font_description_equal (old_theme_node->font_desc,
st_theme_node_get_font (new_theme_node));
if (paint_equal && old_theme_node->foreground_computed)
{
ClutterColor col;
st_theme_node_get_foreground_color (new_theme_node, &col);
paint_equal = clutter_color_equal (&old_theme_node->foreground_color, &col);
}
if (paint_equal && old_theme_node->icon_colors)
paint_equal = st_icon_colors_equal (old_theme_node->icon_colors,
st_theme_node_get_icon_colors (new_theme_node));
if (!paint_equal || !geometry_equal)
g_signal_emit (widget, signals[STYLE_CHANGED], 0);
priv->is_style_dirty = FALSE; priv->is_style_dirty = FALSE;
} }