summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-04-03 19:00:28 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-04-03 19:01:08 -0300
commit966d4b164cbc308316fbcb875853a1d4e3487b2e (patch)
tree6c54989d4dc79eb40fc18276496b1ece38ac91c0
parenta3cf41734aa86a973cf0c95b18ac6d752bda6c22 (diff)
downloadgnome-shell-gbsneto/eager-cache-invalidation.tar.gz
st/theme-context: Invalidate texture cache when scaling changesgbsneto/eager-cache-invalidation
-rw-r--r--src/st/st-texture-cache.c15
-rw-r--r--src/st/st-texture-cache.h2
-rw-r--r--src/st/st-theme-context.c4
3 files changed, 21 insertions, 0 deletions
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 850c0d697..2c9319980 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1619,3 +1619,18 @@ st_texture_cache_rescan_icon_theme (StTextureCache *cache)
return gtk_icon_theme_rescan_if_needed (priv->icon_theme);
}
+
+
+/**
+ * st_texture_cache_invalidate:
+ * @cache: a #StTextureCache
+ *
+ * Invalidates the texture cache, and evicts all icons.
+ */
+void
+st_texture_cache_invalidate (StTextureCache *cache)
+{
+ g_return_if_fail (ST_IS_TEXTURE_CACHE (cache));
+
+ st_texture_cache_evict_icons (cache);
+}
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
index a99316da8..031087d87 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -115,4 +115,6 @@ CoglTexture * st_texture_cache_load (StTextureCache *cache,
gboolean st_texture_cache_rescan_icon_theme (StTextureCache *cache);
+void st_texture_cache_invalidate (StTextureCache *cache);
+
#endif /* __ST_TEXTURE_CACHE_H__ */
diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c
index de112aa49..b21d5de96 100644
--- a/src/st/st-theme-context.c
+++ b/src/st/st-theme-context.c
@@ -176,7 +176,11 @@ st_theme_context_set_property (GObject *object,
int scale_factor = g_value_get_int (value);
if (scale_factor != context->scale_factor)
{
+ StTextureCache *cache = st_texture_cache_get_default ();
+
context->scale_factor = scale_factor;
+
+ st_texture_cache_invalidate (cache);
st_theme_context_changed (context);
}