appDisplay: Use new moveItem API to move items

This uses the API added in the previous commit. The intent here
is to avoid removing and readding actors when moving them around.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3165

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
This commit is contained in:
Georges Basile Stavracas Neto 2020-09-23 16:53:17 -03:00 committed by Florian Müllner
parent ffdff07eaf
commit 062c014223

View File

@ -746,10 +746,14 @@ var BaseAppView = GObject.registerClass({
if (page === newPage && position === newPosition)
return;
if (page !== -1 && position !== -1)
this._removeItem(item);
// Update the _orderedItems array
let index = this._orderedItems.indexOf(item);
this._orderedItems.splice(index, 1);
this._addItem(item, newPage, newPosition);
index = this._getLinearPosition(newPage, newPosition);
this._orderedItems.splice(index, 0, item);
this._grid.moveItem(item, newPage, newPosition);
}
vfunc_allocate(box) {