css: Compare icon theme serials

When comparing to icon theme image values for equality,
take the serial of the icon theme at compute time into
account.
This commit is contained in:
Matthias Clasen 2020-04-22 13:49:18 -04:00
parent fe6ef5256b
commit 58ca3b05c9
2 changed files with 6 additions and 2 deletions

View File

@ -153,6 +153,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
settings = gtk_style_provider_get_settings (provider);
display = _gtk_settings_get_display (settings);
copy->icon_theme = gtk_icon_theme_get_for_display (display);
copy->serial = gtk_icon_theme_get_serial (copy->icon_theme);
copy->scale = gtk_style_provider_get_scale (provider);
gtk_icon_theme_lookup_symbolic_colors (style, &copy->color, &copy->success, &copy->warning, &copy->error);
@ -166,7 +167,9 @@ gtk_css_image_icon_theme_equal (GtkCssImage *image1,
GtkCssImageIconTheme *icon_theme1 = (GtkCssImageIconTheme *) image1;
GtkCssImageIconTheme *icon_theme2 = (GtkCssImageIconTheme *) image2;
return g_str_equal (icon_theme1->name, icon_theme2->name);
return icon_theme1->serial == icon_theme2->serial &&
icon_theme1->icon_theme == icon_theme2->icon_theme &&
g_str_equal (icon_theme1->name, icon_theme2->name);
}
static void

View File

@ -44,7 +44,8 @@ struct _GtkCssImageIconTheme
GdkRGBA success;
GdkRGBA warning;
GdkRGBA error;
gint scale;
int serial;
int scale;
char *name;
int cached_size;