dnd: Finish animation before destroying actor

Otherwise JavaScript aborts the execution of the function
and the drag is never released. That's because _dragComplete
tries to unhide this._dragActor from picking, and that cannot
be done after calling this._dragActor.destroy(), which is
the case now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/744
This commit is contained in:
Georges Basile Stavracas Neto 2018-11-27 12:33:15 -02:00
parent b65b4e3cae
commit 87de09a83e

View File

@ -703,6 +703,9 @@ var _Draggable = class _Draggable {
}
_onAnimationComplete(dragActor, eventTime) {
this.emit('drag-end', eventTime, false);
this._finishAnimation();
if (this._dragOrigParent) {
Main.uiGroup.remove_child(dragActor);
this._dragOrigParent.add_actor(dragActor);
@ -711,9 +714,6 @@ var _Draggable = class _Draggable {
} else {
dragActor.destroy();
}
this.emit('drag-end', eventTime, false);
this._finishAnimation();
}
_dragComplete() {