[gnome-shell/T27795: 3/138] dnd: Finish animation before destroying actor



commit 5b99f69b13675f51f8d979b5abebefc4321b3e43
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Nov 27 12:33:15 2018 -0200

    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

 js/ui/dnd.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 14ccb2af3a..f301510704 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -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() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]