[gnome-shell] lookingGlass: Take separate grab for object inspector



commit cff09617f3bd209cd9e7b5b92b979d051e1f9a73
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 26 18:10:46 2022 +0100

    lookingGlass: Take separate grab for object inspector
    
    The object inspector is not a child of the main looking glass dialog,
    so it no longer receives pointer/touch events with the new grab API.
    
    Fix this by pushing/popping a separate grab.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5150
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2218>

 js/ui/lookingGlass.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 96f4d9cd77..30d668f3c8 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -451,6 +451,14 @@ class ObjInspector extends St.ScrollView {
     open(sourceActor) {
         if (this._open)
             return;
+
+        const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
+        if (grab.get_seat_state() === Clutter.GrabState.NONE) {
+            Main.popModal(grab);
+            return;
+        }
+
+        this._grab = grab;
         this._previousObj = null;
         this._open = true;
         this.show();
@@ -470,6 +478,8 @@ class ObjInspector extends St.ScrollView {
     close() {
         if (!this._open)
             return;
+        Main.popModal(this._grab);
+        this._grab = null;
         this._open = false;
         this.hide();
         this._previousObj = null;


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