[gnome-shell/wip/carlosg/grabs-pt2: 22/23] screenshot: Port to Clutter.Grab




commit 651692f4d05fcbc05c2797a678501bea0f73304c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jan 28 12:13:45 2022 +0100

    screenshot: Port to Clutter.Grab
    
    Stop using device/sequence grabs for corner handles. Also
    make the toplevel actor reactive, so it can handle the key events
    it means to.

 js/ui/screenshot.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index c1f2a16353..97f782e524 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -375,10 +375,10 @@ var UIAreaSelector = GObject.registerClass({
         if (!this._dragButton)
             return;
 
-        if (this._dragSequence)
-            this._dragDevice.sequence_ungrab(this._dragSequence);
-        else
-            this._dragDevice.ungrab();
+        if (this._dragGrab) {
+            this._dragGrab.dismiss();
+            this._dragGrab = null;
+        }
 
         this._dragButton = 0;
         this._dragDevice = null;
@@ -495,11 +495,8 @@ var UIAreaSelector = GObject.registerClass({
 
         if (this._dragButton) {
             const device = event.device;
-            if (sequence)
-                device.sequence_grab(sequence, this);
-            else
-                device.grab(this);
 
+            this._dragGrab = global.stage.grab(this);
             this._dragDevice = device;
             this._dragSequence = sequence;
 
@@ -1010,6 +1007,7 @@ class ScreenshotUI extends St.Widget {
             layout_manager: new Clutter.BinLayout(),
             opacity: 0,
             visible: false,
+            reactive: true,
         });
 
         this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });


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