[gnome-shell/wip/carlosg/grabs-pt2: 17/25] dnd: Use Clutter.grab() for DnD grab
- From: Robert Mader <rmader src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/grabs-pt2: 17/25] dnd: Use Clutter.grab() for DnD grab
- Date: Fri, 28 Jan 2022 12:56:55 +0000 (UTC)
commit b1e4d73998d072c6e581d600bf7e73988d989f66
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]