[gnome-shell/wip/rstrode/login-screen-extensions: 40/134] shellDBus: Add new 'ExtensionStateChanged' signal
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/login-screen-extensions: 40/134] shellDBus: Add new 'ExtensionStateChanged' signal
- Date: Thu, 26 Aug 2021 19:30:59 +0000 (UTC)
commit 704dee1980e2466f728081b181a38041799d8920
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jul 8 12:21:10 2019 +0200
shellDBus: Add new 'ExtensionStateChanged' signal
The existing 'ExtensionStatusChanged' signal has a fixed set of parameters,
which means we cannot add additional state without an API break. Deprecate
it in favor of a new 'ExtensionStateChanged' signal which addresses this
issue by taking the full serialized extension as parameter.
https://bugzilla.gnome.org/show_bug.cgi?id=789852
data/dbus-interfaces/org.gnome.Shell.Extensions.xml | 9 +++++++++
js/extensionPrefs/main.js | 2 +-
js/ui/extensionSystem.js | 5 ++---
js/ui/shellDBus.js | 4 ++++
4 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
b/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
index 22273f889e..6eb3ddc14f 100644
--- a/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
+++ b/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
@@ -226,6 +226,15 @@
<arg type="b" direction="out" name="success"/>
</method>
+ <signal name="ExtensionStateChanged">
+ <arg type="s" name="uuid"/>
+ <arg type="a{sv}" name="state"/>
+ </signal>
+
+ <!--
+ ExtensionStatusChanged:
+ Deprecated for ExtensionStateChanged
+ -->
<signal name="ExtensionStatusChanged">
<arg type="s" name="uuid"/>
<arg type="i" name="state"/>
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index 43efa95e92..2b4ce57535 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -241,7 +241,7 @@ var Application = class {
this._mainStack.add_named(new EmptyPlaceholder(), 'placeholder');
this._shellProxy = new GnomeShellProxy(Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell');
- this._shellProxy.connectSignal('ExtensionStatusChanged', (proxy, senderName, [uuid, state, error])
=> {
+ this._shellProxy.connectSignal('ExtensionStateChanged', (proxy, senderName, [uuid, state]) => {
if (ExtensionUtils.extensions[uuid] !== undefined)
this._scanExtensions();
});
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 8ff0fa56fd..98eaf5259c 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -159,15 +159,14 @@ var ExtensionManager = class {
let message = '' + error;
+ extension.error = message;
extension.state = ExtensionState.ERROR;
if (!extension.errors)
extension.errors = [];
extension.errors.push(message);
log('Extension "%s" had error: %s'.format(uuid, message));
- this.emit('extension-state-changed', { uuid: uuid,
- error: message,
- state: extension.state });
+ this.emit('extension-state-changed', extension);
}
loadExtension(extension) {
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index af5889789d..23274c0a3f 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -335,6 +335,10 @@ var GnomeShellExtensions = class {
}
_extensionStateChanged(_, newState) {
+ let state = ExtensionUtils.serializeExtension(newState);
+ this._dbusImpl.emit_signal('ExtensionStateChanged',
+ new GLib.Variant('(sa{sv})', [newState.uuid, state]));
+
this._dbusImpl.emit_signal('ExtensionStatusChanged',
GLib.Variant.new('(sis)', [newState.uuid, newState.state,
newState.error]));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]