diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 81f5cef84..04b8caf69 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -198,7 +198,11 @@ const IconGrid = new Lang.Class({ _getPreferredHeight: function (grid, forWidth, alloc) { let children = this._getVisibleChildren(); - let [nColumns, usedWidth] = this._computeLayout(forWidth); + let nColumns; + if (forWidth < 0) + nColumns = children.length; + else + nColumns = this._computeLayout(forWidth)[0]; let nRows; if (nColumns > 0) nRows = Math.ceil(children.length / nColumns);