extensionSystem: Disable extension before unloading stylesheet

Removing a stylesheet from the theme will trigger a style update. There's
little point in updating the extension actors that are about to be destroyed
(hopefully), so call the extension's disable() function first.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2757


(cherry picked from commit 6d5e93b00b)
This commit is contained in:
Florian Müllner 2020-05-13 18:10:56 +00:00 committed by Florian Müllner
parent 504d4b7ea4
commit d3934bd685

View File

@ -102,18 +102,18 @@ var ExtensionManager = class {
} }
} }
if (extension.stylesheet) {
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
theme.unload_stylesheet(extension.stylesheet);
delete extension.stylesheet;
}
try { try {
extension.stateObj.disable(); extension.stateObj.disable();
} catch (e) { } catch (e) {
this.logExtensionError(uuid, e); this.logExtensionError(uuid, e);
} }
if (extension.stylesheet) {
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
theme.unload_stylesheet(extension.stylesheet);
delete extension.stylesheet;
}
for (let i = 0; i < order.length; i++) { for (let i = 0; i < order.length; i++) {
let otherUuid = order[i]; let otherUuid = order[i];
try { try {