iconGrid: Only use page relative coords for orientation in getDropTarget

The x and y coordinates were both adjusted to be page relative, even
though the icon grid can only scroll in one direction. This was leading
to coordinates outside of the icon grid to be considered part of it and
a wrong drop target to be chosen.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3779

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1767>
This commit is contained in:
Sebastian Keller 2021-03-14 17:32:26 +01:00 committed by Marge Bot
parent 822340fd86
commit f2db9b52c9

View File

@ -1050,7 +1050,9 @@ var IconGridLayout = GObject.registerClass({
page = swap(page, this._pages.length); page = swap(page, this._pages.length);
// Page-relative coordinates from now on // Page-relative coordinates from now on
if (this._orientation === Clutter.Orientation.HORIZONTAL)
x %= this._pageWidth; x %= this._pageWidth;
else
y %= this._pageHeight; y %= this._pageHeight;
if (x < leftEmptySpace || y < topEmptySpace) if (x < leftEmptySpace || y < topEmptySpace)