[gtk/fix-icontheme-invalidation: 9/18] icontheme: Keep a serial
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix-icontheme-invalidation: 9/18] icontheme: Keep a serial
- Date: Wed, 22 Apr 2020 20:35:31 +0000 (UTC)
commit fe6ef5256b8a4898da3d6661775d2fc90594ee25
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Apr 22 13:47:17 2020 -0400
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.
gtk/gtkicontheme.c | 9 +++++++++
gtk/gtkiconthemeprivate.h | 2 ++
2 files changed, 11 insertions(+)
---
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__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]