summaryrefslogtreecommitdiff
path: root/0001-st-texture-cache-purge-on-resume.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-02 07:11:13 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-02 07:11:13 +0000
commit4671d4f870417e2e0f6b0b4fadfa31570c7752fb (patch)
treee230ed83ee4a856befa7d96addd3d34d78a958b1 /0001-st-texture-cache-purge-on-resume.patch
parentede92676c7c3a698398455318cc45011057260d2 (diff)
automatic import of gnome-shellopeneuler24.03_LTSopeneuler23.09
Diffstat (limited to '0001-st-texture-cache-purge-on-resume.patch')
-rw-r--r--0001-st-texture-cache-purge-on-resume.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/0001-st-texture-cache-purge-on-resume.patch b/0001-st-texture-cache-purge-on-resume.patch
new file mode 100644
index 0000000..1a32fc7
--- /dev/null
+++ b/0001-st-texture-cache-purge-on-resume.patch
@@ -0,0 +1,66 @@
+From 483f0340bb64767bd8d6d95788058270dfdb5def Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Tue, 15 Jan 2019 12:54:32 -0500
+Subject: [PATCH] st-texture-cache: purge on resume
+
+With the proprietary nvidia driver, textures get garbled on suspend,
+so the texture cache needs to evict all textures in that situation.
+---
+ js/ui/main.js | 6 +++++-
+ src/st/st-texture-cache.c | 10 ++++++++++
+ src/st/st-texture-cache.h | 1 +
+ 3 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/js/ui/main.js b/js/ui/main.js
+index 979fcefa5..dbf3a32d3 100644
+--- a/js/ui/main.js
++++ b/js/ui/main.js
+@@ -249,7 +249,11 @@ function _initializeUI() {
+ return true;
+ });
+
+- global.display.connect('gl-video-memory-purged', loadTheme);
++ global.display.connect('gl-video-memory-purged', () => {
++ let cache = St.TextureCache.get_default();
++ cache.clear();
++ loadTheme();
++ });
+
+ // Provide the bus object for gnome-session to
+ // initiate logouts.
+diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
+index b7b547a78..583c3f7d2 100644
+--- a/src/st/st-texture-cache.c
++++ b/src/st/st-texture-cache.c
+@@ -130,6 +130,16 @@ st_texture_cache_class_init (StTextureCacheClass *klass)
+ G_TYPE_NONE, 1, G_TYPE_FILE);
+ }
+
++/* Evicts all cached textures */
++void
++st_texture_cache_clear (StTextureCache *cache)
++{
++ g_return_if_fail (ST_IS_TEXTURE_CACHE (cache));
++
++ g_hash_table_remove_all (cache->priv->keyed_cache);
++ g_signal_emit (cache, signals[ICON_THEME_CHANGED], 0);
++}
++
+ /* Evicts all cached textures for named icons */
+ static void
+ st_texture_cache_evict_icons (StTextureCache *cache)
+diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
+index 55d84952d..948915c30 100644
+--- a/src/st/st-texture-cache.h
++++ b/src/st/st-texture-cache.h
+@@ -53,6 +53,7 @@ typedef enum {
+ } StTextureCachePolicy;
+
+ StTextureCache* st_texture_cache_get_default (void);
++void st_texture_cache_clear (StTextureCache *cache);
+
+ ClutterActor *
+ st_texture_cache_load_sliced_image (StTextureCache *cache,
+--
+2.31.1
+