[gnome-shell] dnd: Don't override fixed position if actor had no fixed position before



commit b2eeda9b46867d8e782e7dde07026aa0f9958459
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Tue Jun 9 18:29:02 2020 +0200

    dnd: Don't override fixed position if actor had no fixed position before
    
    Properly handle drag actors which are not allocated using a fixed
    position and disable the fixed position we were using to move the actor
    around before we reparent it again to its original parent.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1310

 js/ui/dnd.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index cb72737f1c..942786d92a 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -375,8 +375,9 @@ var _Draggable = class _Draggable {
 
             this._dragActorSource = undefined;
             this._dragOrigParent = this.actor.get_parent();
-            this._dragOrigX = this._dragActor.x;
-            this._dragOrigY = this._dragActor.y;
+            this._dragActorHadFixedPos = this._dragActor.fixed_position_set;
+            this._dragOrigX = this._dragActor.allocation.x1;
+            this._dragOrigY = this._dragActor.allocation.y1;
             this._dragOrigScale = this._dragActor.scale_x;
 
             // Set the actor's scale such that it will keep the same
@@ -718,7 +719,10 @@ var _Draggable = class _Draggable {
             Main.uiGroup.remove_child(this._dragActor);
             this._dragOrigParent.add_actor(this._dragActor);
             dragActor.set_scale(this._dragOrigScale, this._dragOrigScale);
-            dragActor.set_position(this._dragOrigX, this._dragOrigY);
+            if (this._dragActorHadFixedPos)
+                dragActor.set_position(this._dragOrigX, this._dragOrigY);
+            else
+                dragActor.fixed_position_set = false;
         } else {
             dragActor.destroy();
         }


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