From 3d7883ee0162e59a4eb21f8f857b94130b1e16a1 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Thu, 7 May 2026 15:42:58 +0200 Subject: [PATCH] fix(themes): refresh abgr cache defensively on theme switch --- HellionChat/Themes/ThemeRegistry.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/HellionChat/Themes/ThemeRegistry.cs b/HellionChat/Themes/ThemeRegistry.cs index 82ea605..59eb2c5 100644 --- a/HellionChat/Themes/ThemeRegistry.cs +++ b/HellionChat/Themes/ThemeRegistry.cs @@ -50,7 +50,14 @@ public sealed class ThemeRegistry public IEnumerable AllCustom() => RefreshCustomCache(); - public void Switch(string slug) => _active = Get(slug); + public void Switch(string slug) + { + var theme = Get(slug); + // Defensive — idempotent and cheap, so any future theme source + // that forgets the cache fill still ends up with a populated one. + theme.RecomputeAbgrCache(); + _active = theme; + } // 0x80070020 = SHARING_VIOLATION, 0x80070021 = LOCK_VIOLATION. Other // IO failures are permanent and get the theme dropped instead of retried.