dnd: Handle dragActorSource getting destroyed

(cherry picked from commit de08ec915f)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2705>
This commit is contained in:
Jonas Dreßler 2022-04-10 18:47:25 +02:00 committed by Florian Müllner
parent 6f92a79d0d
commit 489a32f79a

View file

@ -365,6 +365,10 @@ var _Draggable = class _Draggable {
y = stageY - this._dragActor.height / 2;
}
this._dragActor.set_position(x, y);
this._dragActorSourceDestroyId = this._dragActorSource.connect('destroy', () => {
this._dragActorSource = null;
});
} else {
this._dragActorSource = this.actor;
}
@ -797,6 +801,11 @@ var _Draggable = class _Draggable {
this._dragOrigParent = null;
}
if (this._dragActorSource) {
this._dragActorSource.disconnect(this._dragActorSourceDestroyId);
this._dragActorSource = null;
}
this._dragState = DragState.INIT;
currentDraggable = null;
}