[gnome-boxes/use-new-gnome-settings-app-id] util-app, flatpak: Use new GNOME Settings app-id




commit fa3e129efd3fb41028d62f0fea21b306fd6e7a7a
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Apr 26 16:00:26 2022 +0200

    util-app, flatpak: Use new GNOME Settings app-id
    
    Flatpaked Boxes allows for calling GNOME Control Center when the user doesn't
    grant permissions for the Boxes to run in the background (after closing
    the window) when a VM is marked to "Run in background". This is useful because
    the Applications panel in gnome-control-center allows for reseting the
    flatpak app permissions.
    
    Ever since commit gnome-control-center@acd59aec, the gnome-control-center
    app id got renamed to org.gnome.Settings.
    
    With this changes, Boxes will attempt to activate org.gnome.Settings over
    DBus and fallback to the old org.gnome.ControlCenter when the first fails.
    
    Fixes #787

 build-aux/flatpak/org.gnome.BoxesDevel.json |  1 +
 src/util-app.vala                           | 10 ++++++++++
 2 files changed, 11 insertions(+)
---
diff --git a/build-aux/flatpak/org.gnome.BoxesDevel.json b/build-aux/flatpak/org.gnome.BoxesDevel.json
index 27e90e70..b2e4b609 100644
--- a/build-aux/flatpak/org.gnome.BoxesDevel.json
+++ b/build-aux/flatpak/org.gnome.BoxesDevel.json
@@ -14,6 +14,7 @@
         "--share=network",
         "--device=all",
         "--system-talk-name=org.freedesktop.timedate1",
+        "--talk-name=org.gnome.Settings",
         "--talk-name=org.gnome.ControlCenter",
         "--talk-name=org.freedesktop.secrets",
         "--filesystem=xdg-run/dconf",
diff --git a/src/util-app.vala b/src/util-app.vala
index 5cb92dda..4ba835ec 100644
--- a/src/util-app.vala
+++ b/src/util-app.vala
@@ -673,11 +673,21 @@ private async void move_config_from_cache (string config_name) {
     public void open_permission_settings () {
         try {
             var proxy = new DBusProxy.for_bus_sync (BusType.SESSION,
+                                                    DBusProxyFlags.NONE,
+                                                    null,
+                                                    "org.gnome.Settings",
+                                                    "/org/gnome/Settings",
+                                                    "org.gtk.Actions");
+
+            if (proxy == null) {
+                proxy = new DBusProxy.for_bus_sync (BusType.SESSION,
                                                     DBusProxyFlags.NONE,
                                                     null,
                                                     "org.gnome.ControlCenter",
                                                     "/org/gnome/ControlCenter",
                                                     "org.gtk.Actions");
+            }
+
             var builder = new VariantBuilder (new VariantType ("av"));
             builder.add ("v", new Variant.string (Config.APPLICATION_ID));
             var param = new Variant.tuple ({


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]