[gnome-shell/wip/carlosg/grabs-pt2: 3/14] slider: Use Clutter.grab() for implicit grab




commit 5a677bfe6ba6ab5e45f09347d92ee11c74ab3fd9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 18 00:00:52 2021 +0100

    slider: Use Clutter.grab() for implicit grab

 js/ui/slider.js | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/slider.js b/js/ui/slider.js
index ba3a233f15..52a8a24ea6 100644
--- a/js/ui/slider.js
+++ b/js/ui/slider.js
@@ -73,10 +73,7 @@ var Slider = GObject.registerClass({
         let device = event.get_device();
         let sequence = event.get_event_sequence();
 
-        if (sequence != null)
-            device.sequence_grab(sequence, this);
-        else
-            device.grab(this);
+        this._grab = Clutter.grab(this.get_stage(), this);
 
         this._grabbedDevice = device;
         this._grabbedSequence = sequence;
@@ -98,10 +95,10 @@ var Slider = GObject.registerClass({
                 this._releaseId = 0;
             }
 
-            if (this._grabbedSequence != null)
-                this._grabbedDevice.sequence_ungrab(this._grabbedSequence);
-            else
-                this._grabbedDevice.ungrab();
+            if (this._grab) {
+                Clutter.ungrab(this._grab);
+                this._grab = null;
+            }
 
             this._grabbedSequence = null;
             this._grabbedDevice = null;


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