[gnome-shell/gnome-3-34] weather: Only require auto-location authorization if sandboxed
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-34] weather: Only require auto-location authorization if sandboxed
- Date: Wed, 11 Dec 2019 21:39:58 +0000 (UTC)
commit 5043e6d6bddf6fffa8f89b31a82a9638aa5910b1
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Nov 27 23:01:15 2019 +0100
weather: Only require auto-location authorization if sandboxed
Since commit 87e60ed97843, geoclue no longer pretends that authorization
is useful for system-installed apps (as they can easily lie about their
ID). Unfortunately this broke our auto-location support in case Weather
is installed non-sandboxed, as we are waiting for an authorization that
will never happen.
Unbreak it by only requiring authorization when installed as Flatpak.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1823
js/misc/weather.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/js/misc/weather.js b/js/misc/weather.js
index 51dd8acde8..16d8aae4ad 100644
--- a/js/misc/weather.js
+++ b/js/misc/weather.js
@@ -32,6 +32,7 @@ var WeatherClient = class {
this._gclueStarting = false;
this._gclueLocationChangedId = 0;
+ this._needsAuth = true;
this._weatherAuthorized = false;
this._permStore = new PermissionStore.PermissionStore((proxy, error) => {
if (error) {
@@ -142,7 +143,7 @@ var WeatherClient = class {
get _useAutoLocation() {
return this._autoLocationRequested &&
this._locationSettings.get_boolean('enabled') &&
- this._weatherAuthorized;
+ (!this._needsAuth || this._weatherAuthorized);
}
_onWeatherProxyReady(o, res) {
@@ -175,6 +176,13 @@ var WeatherClient = class {
if (hadApp !== haveApp)
this.emit('changed');
+
+ let neededAuth = this._needsAuth;
+ this._needsAuth = this._weatherApp === null ||
+ this._weatherApp.app_info.has_key('X-Flatpak');
+
+ if (neededAuth !== this._needsAuth)
+ this._updateAutoLocation();
}
_loadInfo() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]