From d9a90d38439d81544ce7d1307ea74f16f2d8cb72 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Fri, 3 Apr 2020 14:16:35 +0200 Subject: [PATCH] Use new convenience function to open settings GS 3.36 introduced a portal-like API for actions like opening settings. That was done in order to make it possible to ship the new extensions app in a sandboxed manner, e.g. via flatpak. While talking to the API directly is a bit cumbersome, luckily there is a convenience function we can make use of (from GS 3.36.2 on). Closes #260. Signed-off-by: Jens Lody --- src/extension.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/extension.js b/src/extension.js index 2a61b15..927c9c2 100644 --- a/src/extension.js +++ b/src/extension.js @@ -965,7 +965,14 @@ class OpenweatherMenuButton extends PanelMenu.Button { _onPreferencesActivate() { this.menu.actor.hide(); - Util.spawn(["gnome-shell-extension-prefs", "openweather-extension@jenslody.de"]); + if (typeof ExtensionUtils.openPrefs === 'function') { + ExtensionUtils.openPrefs(); + } else { + Util.spawn([ + "gnome-shell-extension-prefs", + Me.uuid + ]); + } return 0; }