From b41902f4df3ffdfdc38c0d47e55f61912eb548fa Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" <jstpierre@mecheye.net> Date: Mon, 25 Feb 2013 19:31:03 -0500 Subject: [PATCH] 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 --- js/ui/workspace.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);