[gnome-shell/wip/carlosg/grabs-pt2: 10/15] dnd: Use Clutter.grab() for DnD grab




commit e15a09d114168e3fd1582cfe6758305031d0cc27
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 18 00:41:20 2021 +0100

    dnd: Use Clutter.grab() for DnD grab
    
    We still listen to an specific device or touch sequence, but we
    don't grab it specifically.

 js/ui/dnd.js | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index cefde6f603..f6324f14e0 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -165,11 +165,7 @@ var _Draggable = class _Draggable {
     }
 
     _grabDevice(actor, pointer, touchSequence) {
-        if (touchSequence)
-            pointer.sequence_grab(touchSequence, actor);
-        else if (pointer)
-            pointer.grab(actor);
-
+        this._grab = global.stage.grab(actor);
         this._grabbedDevice = pointer;
         this._touchSequence = touchSequence;
 
@@ -188,11 +184,10 @@ var _Draggable = class _Draggable {
             this._capturedEventId = 0;
         }
 
-        if (this._touchSequence)
-            this._grabbedDevice.sequence_ungrab(this._touchSequence);
-        else
-            this._grabbedDevice.ungrab();
-
+        if (this._grab) {
+            this._grab.dismiss();
+            this._grab = null;
+        }
         this._touchSequence = null;
         this._grabbedDevice = null;
     }


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