gnome-shell-extension-appindicator icon indicating copy to clipboard operation
gnome-shell-extension-appindicator copied to clipboard

apps that don't implement menu property crash

Open Damrod opened this issue 2 months ago • 0 comments

I'm trying to use this together with iwgtk, but it keeps flashing in and out of existence. Debian 13.

$ journalctl /usr/bin/gnome-shell -f
...
Sep 21 19:27:42 sulimo gnome-shell[3104]: DING: DBus interface for Nautilus-Sushi (org.gnome.NautilusPreviewer) is now available. Sep 21 19:27:45 sulimo gnome-shell[3104]: While initalizing proxy for org.kde.StatusNotifierItem-3293-1: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.UnknownProperty: Property 'Menu' is not implemented Stack trace: _promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:453:45 @resource:///org/gnome/shell/ui/init.js:21:20 ### Promise created here: ### getProperty@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/dbusProxy.js:89:33 refreshProperty@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/appIndicator.js:306:48 _checkNeededProperties/<@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/appIndicator.js:510:33 _checkNeededProperties@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/appIndicator.js:509:66 async*_setupProxy@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/appIndicator.js:435:24 async*AppIndicator@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/appIndicator.js:419:14 _registerItem@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:95:31 _ensureItemRegistered@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:140:20 RegisterStatusNotifierItemAsync@file:///home/alvaro/.local/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:205:24 async*_handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35 _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34 @resource:///org/gnome/shell/ui/init.js:21:20

I've come to understand menus are not compulsory, so this should be handled.

This patch fixes it for my use case:

diff --git a/appIndicator.js b/appIndicator.js
index 8466671..7fbf20d 100644
--- a/appIndicator.js
+++ b/appIndicator.js
@@ -303,8 +303,12 @@ class AppIndicatorProxy extends DBusProxy {
         });
 
         try {
-            const [valueVariant] = (await this.getProperty(
-                propertyName, cancellable)).deep_unpack();
+			const value = (await this.getProperty(
+                propertyName, cancellable));
+			if (value === null) {
+				return;
+			}
+            const [valueVariant] = value.deep_unpack();
 
             this._cancellables.delete(propertyName);
             await this._queuePropertyUpdate(propertyName, valueVariant,
diff --git a/dbusProxy.js b/dbusProxy.js
index edf16fc..7cbdf07 100644
--- a/dbusProxy.js
+++ b/dbusProxy.js
@@ -85,13 +85,23 @@ export const DBusProxy = GObject.registerClass({
     _onSignal() {
     }
 
-    getProperty(propertyName, cancellable) {
-        return this.gConnection.call(this.gName,
-            this.gObjectPath, 'org.freedesktop.DBus.Properties', 'Get',
-            GLib.Variant.new('(ss)', [this.gInterfaceName, propertyName]),
-            DBusProxy.TUPLE_VARIANT_TYPE, Gio.DBusCallFlags.NONE, -1,
-            cancellable);
-    }
+	async getProperty(propertyName, cancellable) {
+		try {
+			const result = await this.gConnection.call(this.gName,
+				this.gObjectPath, 'org.freedesktop.DBus.Properties', 'Get',
+				GLib.Variant.new('(ss)', [this.gInterfaceName, propertyName]),
+				DBusProxy.TUPLE_VARIANT_TYPE, Gio.DBusCallFlags.NONE, -1,
+				cancellable);
+			return result;
+		} catch (err) {
+			if (err.message && err.message.includes("UnknownProperty: Property 'Menu'")) {
+				log(`AppIndicator: Menu property not implemented by this indicator. Skipping menu.`);
+				return null;
+			}
+			throw err;
+		}
+	}
+
 
     getProperties(cancellable) {
         return this.gConnection.call(this.gName,

Damrod avatar Sep 21 '25 18:09 Damrod