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