dnd: Also consider indirect scaling of dnd actor

Some actors don't have the scale applied to them directly but are
children of a scaled parent. In those case just retaining the scale will
not be enough and the scale of the actor itself needs to be adjusted
when reparenting. This could for example be seen when dragging windows
from the workspace thumbnails.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1687>
This commit is contained in:
Sebastian Keller 2021-02-17 01:00:27 +01:00 committed by Marge Bot
parent cf41f4a527
commit a24a16c5ac

View File

@ -400,6 +400,9 @@ var _Draggable = class _Draggable {
scaledWidth = transformedExtents.get_width();
scaledHeight = transformedExtents.get_height();
this._dragActor.scale_x = scaledWidth / this._dragOrigWidth;
this._dragActor.scale_y = scaledHeight / this._dragOrigHeight;
this._dragOrigParent.remove_actor(this._dragActor);
Main.uiGroup.add_child(this._dragActor);
Main.uiGroup.set_child_above_sibling(this._dragActor, null);