From 89ba8562c3c309b9e0bb5c453c907d05d284e5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 9 Jun 2020 18:31:23 +0200 Subject: [PATCH] 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 f356c03c7..464d61bb8 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);