fix(themes): refresh abgr cache defensively on theme switch

This commit is contained in:
2026-05-07 15:42:58 +02:00
parent e4ee7aaafa
commit 3d7883ee01
+8 -1
View File
@@ -50,7 +50,14 @@ public sealed class ThemeRegistry
public IEnumerable<Theme> 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.