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:
parent
ada70dd683
commit
b41902f4df
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user