workspace: Only create one strategy

Now that we don't have any other strategies but the unaligned
one, we only need to construct it once.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
This commit is contained in:
Jasper St. Pierre 2013-02-25 19:31:03 -05:00
parent ada70dd683
commit b41902f4df

View File

@ -1475,6 +1475,8 @@ const Workspace = new Lang.Class({
let lastLayout = {}; let lastLayout = {};
let strategy = new UnalignedLayoutStrategy(this._monitor, rowSpacing, columnSpacing);
for (let numRows = 1; ; numRows++) { for (let numRows = 1; ; numRows++) {
let numColumns = Math.ceil(windows.length / numRows); let numColumns = Math.ceil(windows.length / numRows);
@ -1484,8 +1486,6 @@ const Workspace = new Lang.Class({
if (numColumns == lastLayout.numColumns) if (numColumns == lastLayout.numColumns)
break; break;
let strategy = new UnalignedLayoutStrategy(this._monitor, rowSpacing, columnSpacing);
let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns }; let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns };
strategy.computeLayout(windows, layout); strategy.computeLayout(windows, layout);
strategy.computeScaleAndSpace(layout); strategy.computeScaleAndSpace(layout);