[gnome-shell] dnd: Set drag actor position immediately after reparenting



commit 89ba8562c3c309b9e0bb5c453c907d05d284e5f5
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Tue Jun 9 18:31:23 2020 +0200

    dnd: Set drag actor position immediately after reparenting
    
    For drag actors which get reparented to the uiGroup, we currently wait
    until the next input event to set the fixed position of the actor, until
    that they will just be allocated their old fixed position, which is 0,
    0.
    
    So avoid drag actors flickering at the top left for one frame and
    position them correctly right after reparenting.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1310

 js/ui/dnd.js | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index f356c03c7e..464d61bb83 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -428,6 +428,10 @@ var _Draggable = class _Draggable {
         this._dragOffsetX -= transX;
         this._dragOffsetY -= transY;
 
+        this._dragActor.set_position(
+            this._dragX + this._dragOffsetX,
+            this._dragY + this._dragOffsetY);
+
         if (this._dragActorMaxSize != undefined) {
             let [scaledWidth, scaledHeight] = this._dragActor.get_transformed_size();
             let currentSize = Math.max(scaledWidth, scaledHeight);


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