diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 67f3b939d..6405050ce 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -1475,6 +1475,8 @@ const Workspace = new Lang.Class({ let lastLayout = {}; + let strategy = new UnalignedLayoutStrategy(this._monitor, rowSpacing, columnSpacing); + for (let numRows = 1; ; numRows++) { let numColumns = Math.ceil(windows.length / numRows); @@ -1484,8 +1486,6 @@ const Workspace = new Lang.Class({ if (numColumns == lastLayout.numColumns) break; - let strategy = new UnalignedLayoutStrategy(this._monitor, rowSpacing, columnSpacing); - let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns }; strategy.computeLayout(windows, layout); strategy.computeScaleAndSpace(layout);