Blame SOURCES/0001-a11y-Change-HC-icon-theme-first.patch

bd9c5f
From a94260b4f2f72ea9328a0194b8656f1fb3e98675 Mon Sep 17 00:00:00 2001
bd9c5f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
bd9c5f
Date: Sat, 14 Dec 2019 19:15:53 +0100
bd9c5f
Subject: [PATCH] a11y: Change HC icon theme first
bd9c5f
bd9c5f
There are two ways for applications to provide a high contrast icon:
bd9c5f
bd9c5f
 1. install an icon into the HighContrast theme
bd9c5f
 2. install a symbolic icon into the default hicolor theme
bd9c5f
bd9c5f
The latter is preferred nowadays, and implemented in the high-contrast
bd9c5f
CSS variant by enforcing the symbolic icon style.
bd9c5f
bd9c5f
However together with the way we currently enable/disable high-contrast,
bd9c5f
this can lead to the following race:
bd9c5f
 1. the GTK theme is changed from HighContrast
bd9c5f
 2. we reload the default stylesheet
bd9c5f
 3. the icon style changes to "regular", so we request a
bd9c5f
    new icon from the HighContrast icon theme
bd9c5f
 4. the icon theme is changed from HighContrast
bd9c5f
 5. we evict existing icons from the cache
bd9c5f
 6. we reload icons for the new icon theme; however as we
bd9c5f
    find a pending request (from 3), we re-use it
bd9c5f
 7. the request from 3 finishes, and we end up with a
bd9c5f
    wrong icon in the cache
bd9c5f
bd9c5f
The simplest fix is to change the icon theme before the GTK theme: Unlike the
bd9c5f
theme name, the icon style is encoded in the cache key, so we won't re-use
bd9c5f
an old (and incorrect) request in that case.
bd9c5f
---
bd9c5f
 js/ui/status/accessibility.js | 6 +++---
bd9c5f
 1 file changed, 3 insertions(+), 3 deletions(-)
bd9c5f
bd9c5f
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
bd9c5f
index 10223ec84..90948d465 100644
bd9c5f
--- a/js/ui/status/accessibility.js
bd9c5f
+++ b/js/ui/status/accessibility.js
bd9c5f
@@ -154,14 +154,14 @@ class ATIndicator extends PanelMenu.Button {
bd9c5f
             interfaceSettings.is_writable(KEY_ICON_THEME),
bd9c5f
             enabled => {
bd9c5f
                 if (enabled) {
bd9c5f
-                    interfaceSettings.set_string(KEY_GTK_THEME, HIGH_CONTRAST_THEME);
bd9c5f
                     interfaceSettings.set_string(KEY_ICON_THEME, HIGH_CONTRAST_THEME);
bd9c5f
+                    interfaceSettings.set_string(KEY_GTK_THEME, HIGH_CONTRAST_THEME);
bd9c5f
                 } else if(!hasHC) {
bd9c5f
-                    interfaceSettings.set_string(KEY_GTK_THEME, gtkTheme);
bd9c5f
                     interfaceSettings.set_string(KEY_ICON_THEME, iconTheme);
bd9c5f
+                    interfaceSettings.set_string(KEY_GTK_THEME, gtkTheme);
bd9c5f
                 } else {
bd9c5f
-                    interfaceSettings.reset(KEY_GTK_THEME);
bd9c5f
                     interfaceSettings.reset(KEY_ICON_THEME);
bd9c5f
+                    interfaceSettings.reset(KEY_GTK_THEME);
bd9c5f
                 }
bd9c5f
             });
bd9c5f
         return highContrast;
bd9c5f
-- 
bd9c5f
2.23.0
bd9c5f