[gnome-shell-extensions] window-list: Adapt to Clutter.Grab changes



commit 69527857f828ff139d427e6b4ae059c921aeb740
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 9 23:59:14 2022 +0100

    window-list: Adapt to Clutter.Grab changes
    
    pushModal() now returns a grab object that has to be passed to
    popModal() to release the grab.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/212>

 extensions/window-list/windowPicker.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/extensions/window-list/windowPicker.js b/extensions/window-list/windowPicker.js
index a34f731..658a5db 100644
--- a/extensions/window-list/windowPicker.js
+++ b/extensions/window-list/windowPicker.js
@@ -273,17 +273,21 @@ var WindowPicker = GObject.registerClass({
             if (this._modal)
                 return true;
 
-            this._modal = Main.pushModal(this, {
+            const grab = Main.pushModal(global.stage, {
                 actionMode: Shell.ActionMode.OVERVIEW,
             });
-
-            if (!this._modal) {
+            if (grab.get_seat_state() !== Clutter.GrabState.NONE) {
+                this._grab = grab;
+                this._modal = true;
+            } else {
+                Main.popModal(grab);
                 this.hide();
                 return false;
             }
         } else if (this._modal) {
-            Main.popModal(this);
+            Main.popModal(this._grab);
             this._modal = false;
+            this._grab = null;
         }
         return true;
     }


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