[gnome-shell/wip/carlosg/grabs-pt2: 19/25] dnd: Use Clutter.grab() for DnD grab
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/grabs-pt2: 19/25] dnd: Use Clutter.grab() for DnD grab
- Date: Tue, 25 Jan 2022 10:52:57 +0000 (UTC)
commit 0a98ffbeef4d8429414c11e7c8e4ec7c4c462e12
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]