extensionUtils: Add DISABLING and ENABLING extension states
Extensions can export asynchronous enable() and disable() functions. To guard against re-entrancy when enabling or disabling an extension, this commit adds two new states: ENABLING and DISABLING which are set immediately prior to calling enable() and disable() respectively. This commit updates the extensions CLI and Extensions app with new strings for these states. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2364>
This commit is contained in:
@ -100,6 +100,9 @@ var ExtensionManager = class extends Signals.EventEmitter {
|
||||
if (extension.state != ExtensionState.ENABLED)
|
||||
return;
|
||||
|
||||
extension.state = ExtensionState.DISABLING;
|
||||
this.emit('extension-state-changed', extension);
|
||||
|
||||
// "Rebase" the extension order by disabling and then enabling extensions
|
||||
// in order to help prevent conflicts.
|
||||
|
||||
@ -164,6 +167,9 @@ var ExtensionManager = class extends Signals.EventEmitter {
|
||||
if (extension.state != ExtensionState.DISABLED)
|
||||
return;
|
||||
|
||||
extension.state = ExtensionState.ENABLING;
|
||||
this.emit('extension-state-changed', extension);
|
||||
|
||||
let stylesheetNames = [`${global.session_mode}.css`, 'stylesheet.css'];
|
||||
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
||||
for (let i = 0; i < stylesheetNames.length; i++) {
|
||||
|
Reference in New Issue
Block a user