[gnome-shell/wip/rstrode/login-screen-extensions: 94/134] introspect: Include `sandboxed-app-id` as well




commit 370c1982c65da5ba83bf47649a484fbc25c7f767
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu May 16 00:57:27 2019 +0200

    introspect: Include `sandboxed-app-id` as well
    
    App IDs in gnome-shell don't match AppStream, Flatpak or Snap IDs. For the
    desktop portal, the latter two are more relevant, so include it in the
    returned information.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1289

 js/misc/introspect.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/js/misc/introspect.js b/js/misc/introspect.js
index f7a7f2fe6d..1e8300d0a7 100644
--- a/js/misc/introspect.js
+++ b/js/misc/introspect.js
@@ -55,6 +55,11 @@ var IntrospectService = class {
        return APP_WHITELIST.includes(sender);
     }
 
+    _getSandboxedAppId(app) {
+        let ids = app.get_windows().map(w => w.get_sandboxed_app_id());
+        return ids.find(id => id != null);
+    }
+
     _syncRunningApplications() {
         let tracker = Shell.WindowTracker.get_default();
         let apps = this._appSystem.get_running();
@@ -76,6 +81,10 @@ var IntrospectService = class {
                 newActiveApplication = app.get_id();
             }
 
+            let sandboxedAppId = this._getSandboxedAppId(app);
+            if (sandboxedAppId)
+                appInfo['sandboxed-app-id'] = new GLib.Variant('s', sandboxedAppId);
+
             newRunningApplications[app.get_id()] = appInfo;
         }
 
@@ -137,6 +146,7 @@ var IntrospectService = class {
                 let frameRect = window.get_frame_rect();
                 let title = window.get_title();
                 let wmClass = window.get_wm_class();
+                let sandboxedAppId = window.get_sandboxed_app_id();
 
                 windowsList[windowId] = {
                     'app-id': GLib.Variant.new('s', app.get_id()),
@@ -153,6 +163,10 @@ var IntrospectService = class {
 
                 if (wmClass != null)
                     windowsList[windowId]['wm-class'] = GLib.Variant.new('s', wmClass);
+
+                if (sandboxedAppId != null)
+                    windowsList[windowId]['sandboxed-app-id'] =
+                        GLib.Variant.new('s', sandboxedAppId);
             }
         }
         invocation.return_value(new GLib.Variant('(a{ta{sv}})', [windowsList]));


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