[gnome-shell/gbsneto/dnd-fixes: 3/3] dnd: Finish animation before destroying actor



commit 33a7128594ee9dd70d0810c4d2f783aa9e7f79b6
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://phabricator.endlessm.com/T24387

 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 d9f45a3308..dd731cfbad 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]