|
|
1bd53d |
From 483f0340bb64767bd8d6d95788058270dfdb5def Mon Sep 17 00:00:00 2001
|
|
|
1bd53d |
From: Ray Strode <rstrode@redhat.com>
|
|
|
1bd53d |
Date: Tue, 15 Jan 2019 12:54:32 -0500
|
|
|
1bd53d |
Subject: [PATCH] st-texture-cache: purge on resume
|
|
|
1bd53d |
|
|
|
1bd53d |
With the proprietary nvidia driver, textures get garbled on suspend,
|
|
|
1bd53d |
so the texture cache needs to evict all textures in that situation.
|
|
|
1bd53d |
---
|
|
|
1bd53d |
js/ui/main.js | 6 +++++-
|
|
|
1bd53d |
src/st/st-texture-cache.c | 10 ++++++++++
|
|
|
1bd53d |
src/st/st-texture-cache.h | 1 +
|
|
|
1bd53d |
3 files changed, 16 insertions(+), 1 deletion(-)
|
|
|
1bd53d |
|
|
|
1bd53d |
diff --git a/js/ui/main.js b/js/ui/main.js
|
|
|
1bd53d |
index 979fcefa5..dbf3a32d3 100644
|
|
|
1bd53d |
--- a/js/ui/main.js
|
|
|
1bd53d |
+++ b/js/ui/main.js
|
|
|
1bd53d |
@@ -249,7 +249,11 @@ function _initializeUI() {
|
|
|
1bd53d |
return true;
|
|
|
1bd53d |
});
|
|
|
1bd53d |
|
|
|
1bd53d |
- global.display.connect('gl-video-memory-purged', loadTheme);
|
|
|
1bd53d |
+ global.display.connect('gl-video-memory-purged', () => {
|
|
|
1bd53d |
+ let cache = St.TextureCache.get_default();
|
|
|
1bd53d |
+ cache.clear();
|
|
|
1bd53d |
+ loadTheme();
|
|
|
1bd53d |
+ });
|
|
|
1bd53d |
|
|
|
1bd53d |
// Provide the bus object for gnome-session to
|
|
|
1bd53d |
// initiate logouts.
|
|
|
1bd53d |
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
|
|
|
1bd53d |
index b7b547a78..583c3f7d2 100644
|
|
|
1bd53d |
--- a/src/st/st-texture-cache.c
|
|
|
1bd53d |
+++ b/src/st/st-texture-cache.c
|
|
|
1bd53d |
@@ -130,6 +130,16 @@ st_texture_cache_class_init (StTextureCacheClass *klass)
|
|
|
1bd53d |
G_TYPE_NONE, 1, G_TYPE_FILE);
|
|
|
1bd53d |
}
|
|
|
1bd53d |
|
|
|
1bd53d |
+/* Evicts all cached textures */
|
|
|
1bd53d |
+void
|
|
|
1bd53d |
+st_texture_cache_clear (StTextureCache *cache)
|
|
|
1bd53d |
+{
|
|
|
1bd53d |
+ g_return_if_fail (ST_IS_TEXTURE_CACHE (cache));
|
|
|
1bd53d |
+
|
|
|
1bd53d |
+ g_hash_table_remove_all (cache->priv->keyed_cache);
|
|
|
1bd53d |
+ g_signal_emit (cache, signals[ICON_THEME_CHANGED], 0);
|
|
|
1bd53d |
+}
|
|
|
1bd53d |
+
|
|
|
1bd53d |
/* Evicts all cached textures for named icons */
|
|
|
1bd53d |
static void
|
|
|
1bd53d |
st_texture_cache_evict_icons (StTextureCache *cache)
|
|
|
1bd53d |
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
|
|
|
1bd53d |
index 55d84952d..948915c30 100644
|
|
|
1bd53d |
--- a/src/st/st-texture-cache.h
|
|
|
1bd53d |
+++ b/src/st/st-texture-cache.h
|
|
|
1bd53d |
@@ -53,6 +53,7 @@ typedef enum {
|
|
|
1bd53d |
} StTextureCachePolicy;
|
|
|
1bd53d |
|
|
|
1bd53d |
StTextureCache* st_texture_cache_get_default (void);
|
|
|
1bd53d |
+void st_texture_cache_clear (StTextureCache *cache);
|
|
|
1bd53d |
|
|
|
1bd53d |
ClutterActor *
|
|
|
1bd53d |
st_texture_cache_load_sliced_image (StTextureCache *cache,
|
|
|
1bd53d |
--
|
|
|
1bd53d |
2.31.1
|
|
|
1bd53d |
|