[gnome-shell] introspect: Add WindowsChanged signal



commit b832324edee2f259c8412b4a557623611172a69a
Author: Cenk Uluisik <cenk uluisik googlemail com>
Date:   Sun Mar 6 19:32:48 2022 +0100

    introspect: Add WindowsChanged signal
    
    The screencast portal supports recording a single window,
    and presents a list of open windows when that option is
    selected. To allow updating that list when windows are
    opened or closed, add a new "WindowsChanged" signal that
    the portal can listen to.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2229>

 data/dbus-interfaces/org.gnome.Shell.Introspect.xml | 6 ++++++
 js/misc/introspect.js                               | 3 +++
 2 files changed, 9 insertions(+)
---
diff --git a/data/dbus-interfaces/org.gnome.Shell.Introspect.xml 
b/data/dbus-interfaces/org.gnome.Shell.Introspect.xml
index 47fd7efdc2..cb19cfec56 100644
--- a/data/dbus-interfaces/org.gnome.Shell.Introspect.xml
+++ b/data/dbus-interfaces/org.gnome.Shell.Introspect.xml
@@ -18,6 +18,12 @@
     -->
     <signal name="RunningApplicationsChanged" />
 
+    <!--
+        WindowsChanged:
+        @short_description: Notifies when any window opens or closes
+    -->
+    <signal name="WindowsChanged" />
+
     <!--
         GetRunningApplications:
         @short_description: Retrieves the description of all running applications
diff --git a/js/misc/introspect.js b/js/misc/introspect.js
index 45eee81ce3..8916804e7f 100644
--- a/js/misc/introspect.js
+++ b/js/misc/introspect.js
@@ -42,6 +42,9 @@ var IntrospectService = class {
                             this._syncRunningApplications();
                         });
 
+        tracker.connect('tracked-windows-changed',
+            () => this._dbusImpl.emit_signal('WindowsChanged', null));
+
         this._syncRunningApplications();
 
         this._senderChecker = new DBusSenderChecker(APP_ALLOWLIST);


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