baseAppView: Add only non-added icons, in order
In the close future, BaseAppView will only add new icons (compared to the remove all + readd all approach that is now). With that, the items in the this._allItems array will be iterated multiple times, but items can only be added once, and in the order they're in the array. Add the items in the this._allItems array passing the index they should be added, and don't add icons with a parent already set. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645
This commit is contained in:
parent
48a2b6cb0b
commit
47d2f4dbeb
@ -149,7 +149,15 @@ class BaseAppView {
|
||||
|
||||
_loadGrid() {
|
||||
this._allItems.sort(this._compareItems);
|
||||
this._allItems.forEach(item => this._grid.addItem(item));
|
||||
|
||||
this._allItems.forEach((item, index) => {
|
||||
// Don't readd already added items
|
||||
if (item.actor.get_parent())
|
||||
return;
|
||||
|
||||
this._grid.addItem(item, index);
|
||||
});
|
||||
|
||||
this.emit('view-loaded');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user