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




commit 76cacfaa511d262277c26e9d4f719f2b5bfb2c40
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 | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index cefde6f603..e61b69363c 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 = Clutter.grab(global.stage, actor);
         this._grabbedDevice = pointer;
         this._touchSequence = touchSequence;
 
@@ -188,11 +184,9 @@ var _Draggable = class _Draggable {
             this._capturedEventId = 0;
         }
 
-        if (this._touchSequence)
-            this._grabbedDevice.sequence_ungrab(this._touchSequence);
-        else
-            this._grabbedDevice.ungrab();
+        Clutter.ungrab(this._grab);
 
+        this._grab = null;
         this._touchSequence = null;
         this._grabbedDevice = null;
     }


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