dnd: Use Clutter.grab() for DnD grab
We still listen to an specific device or touch sequence, but we don't grab it specifically. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
This commit is contained in:
parent
bad385d15c
commit
5305bee94c
15
js/ui/dnd.js
15
js/ui/dnd.js
@ -165,11 +165,7 @@ var _Draggable = class _Draggable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_grabDevice(actor, pointer, touchSequence) {
|
_grabDevice(actor, pointer, touchSequence) {
|
||||||
if (touchSequence)
|
this._grab = global.stage.grab(actor);
|
||||||
pointer.sequence_grab(touchSequence, actor);
|
|
||||||
else if (pointer)
|
|
||||||
pointer.grab(actor);
|
|
||||||
|
|
||||||
this._grabbedDevice = pointer;
|
this._grabbedDevice = pointer;
|
||||||
this._touchSequence = touchSequence;
|
this._touchSequence = touchSequence;
|
||||||
|
|
||||||
@ -188,11 +184,10 @@ var _Draggable = class _Draggable {
|
|||||||
this._capturedEventId = 0;
|
this._capturedEventId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._touchSequence)
|
if (this._grab) {
|
||||||
this._grabbedDevice.sequence_ungrab(this._touchSequence);
|
this._grab.dismiss();
|
||||||
else
|
this._grab = null;
|
||||||
this._grabbedDevice.ungrab();
|
}
|
||||||
|
|
||||||
this._touchSequence = null;
|
this._touchSequence = null;
|
||||||
this._grabbedDevice = null;
|
this._grabbedDevice = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user