gnome-shell/0001-st-texture-cache-purge-on-resume.patch
Florian Müllner b1227a1d04
Re-apply downstream patches
Not all patches have been upstreamed, so re-apply the changes from
RHEL 9 that are still relevant.

Downstream branding will be different in RHEL 10, so it has been
left out for now and will be handled in a separate issue.

Resolves: RHEL-32989
2024-04-16 20:51:39 +02:00

67 lines
2.1 KiB
Diff

From 458413d859549b12c6be5c263d3f9a66adf2e929 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 9f1697df2b..8cb2963d34 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -265,7 +265,11 @@ async 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();
+ });
global.context.connect('notify::unsafe-mode', () => {
if (!global.context.unsafe_mode)
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index b93db94b5a..07ce0e00bc 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -129,6 +129,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 1c5be957c4..1a4bfde73f 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -52,6 +52,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.44.0