summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-04-22 13:47:17 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-04-22 15:18:16 -0400
commitfe6ef5256b8a4898da3d6661775d2fc90594ee25 (patch)
tree95fa57778e803e25176b6b216bebceb2564a3638
parent2ddff872cd965c687f16cf7cc2053b230acfd5dc (diff)
downloadgtk+-fe6ef5256b8a4898da3d6661775d2fc90594ee25.tar.gz
icontheme: Keep a serial
This will let us identify when we have to re-lookup icons because they may have changed despite the theme object being the same.
-rw-r--r--gtk/gtkicontheme.c9
-rw-r--r--gtk/gtkiconthemeprivate.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index cce4706c95..4cb92350e5 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -331,6 +331,8 @@ struct _GtkIconTheme
GList *dir_mtimes;
gulong theme_changed_idle;
+
+ int serial;
};
struct _GtkIconThemeClass
@@ -1367,6 +1369,13 @@ blow_themes (GtkIconTheme *self)
self->unthemed_icons = NULL;
self->dir_mtimes = NULL;
self->themes_valid = FALSE;
+ self->serial++;
+}
+
+int
+gtk_icon_theme_get_serial (GtkIconTheme *self)
+{
+ return self->serial;
}
static void
diff --git a/gtk/gtkiconthemeprivate.h b/gtk/gtkiconthemeprivate.h
index 495662d1aa..44225fb57a 100644
--- a/gtk/gtkiconthemeprivate.h
+++ b/gtk/gtkiconthemeprivate.h
@@ -41,4 +41,6 @@ void gtk_icon_paintable_snapshot_with_colors (GtkIconPaintable *icon,
const GdkRGBA *warning_color,
const GdkRGBA *error_color);
+int gtk_icon_theme_get_serial (GtkIconTheme *self);
+
#endif /* __GTK_ICON_THEME_PRIVATE_H__ */