[gnome-maps/bilelmoussaoui/location-portal: 2/2] WIP: geoclue: use the portal when sandboxed




commit ee9dd040c620af5a7f0724b69187129e6eeb38d3
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Jan 12 10:30:29 2022 +0100

    WIP: geoclue: use the portal when sandboxed

 org.gnome.Maps.json | 18 +++++++++++++++++-
 src/geoclue.js      | 10 +++++++---
 2 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/org.gnome.Maps.json b/org.gnome.Maps.json
index 842ea6a1..a4407f7f 100644
--- a/org.gnome.Maps.json
+++ b/org.gnome.Maps.json
@@ -19,7 +19,6 @@
         "--talk-name=org.gnome.evolution.dataserver.Calendar7",
         "--talk-name=org.gnome.evolution.dataserver.Sources5",
         "--talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*",
-        "--system-talk-name=org.freedesktop.GeoClue2",
         "--metadata=X-DConf=migrate-path=/org/gnome/Maps",
         "--env=G_ENABLE_DIAGNOSTICS=1"
     ],
@@ -37,6 +36,23 @@
     ],
     "modules" : [
        {
+            "name": "libgeoclue",
+            "buildsystem": "meson",
+            "config-opts" : [
+                "-Denable-backend=false",
+                "-Dlibgeoclue=true",
+                "-Dintrospection=true",
+                "-Dgtk-doc=false"
+            ],
+            "sources": [
+                {
+                    "type" : "git",
+                    "url": "https://gitlab.freedesktop.org/bilelmoussaoui/geoclue.git";,
+                    "branch": "bilelmoussaoui/use-parent-id"
+                }
+            ]
+        },
+        {
            "name": "libical",
            "cleanup": [ "/lib/cmake" ],
            "buildsystem": "cmake-ninja",
diff --git a/src/geoclue.js b/src/geoclue.js
index 864d9897..af127355 100644
--- a/src/geoclue.js
+++ b/src/geoclue.js
@@ -90,9 +90,13 @@ var Geoclue = GObject.registerClass({
 
             this._simple.connect('notify::location',
                                  () => this._onLocationNotify(this._simple));
-            this._simple.client.connect('notify::active', () => {
-                this.state = this._simple.client.active ? State.ON : State.DENIED;
-            });
+
+            // geoclue doesn't use a client proxy inside the flatpak sandbox
+            if (this._simple.client) {
+                this._simple.client.connect('notify::active', () => {
+                    this.state = this._simple.client.active ? State.ON : State.DENIED;
+                });
+            }
 
             this.state = State.ON;
             this._onLocationNotify(this._simple);


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