workspace: Calculate the window slots when we reposition

Repositioning will eventually be separated from recalculation
to accomodate two different geometries, so we'll need to do
the padding and area manipulation in two different areas.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
This commit is contained in:
Jasper St. Pierre 2013-02-25 22:41:40 -05:00
parent 65eb5a3d05
commit 59ba5504d0

View File

@ -1039,8 +1039,12 @@ const Workspace = new Lang.Class({
let initialPositioning = flags & WindowPositionFlags.INITIAL; let initialPositioning = flags & WindowPositionFlags.INITIAL;
let animate = flags & WindowPositionFlags.ANIMATE; let animate = flags & WindowPositionFlags.ANIMATE;
// Start the animations let layout = this._computeLayout(clones);
let slots = this._computeAllWindowSlots(clones); let strategy = layout.strategy;
let [, , padding] = this._getSpacingAndPadding();
let area = padArea(this._fullGeometry, padding);
let slots = strategy.computeWindowSlots(layout, area);
let currentWorkspace = global.screen.get_active_workspace(); let currentWorkspace = global.screen.get_active_workspace();
let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace; let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace;
@ -1484,7 +1488,7 @@ const Workspace = new Lang.Class({
} }
}, },
_computeLayout: function(windows, area, rowSpacing, columnSpacing) { _getBestLayout: function(windows, area, rowSpacing, columnSpacing) {
// We look for the largest scale that allows us to fit the // We look for the largest scale that allows us to fit the
// largest row/tallest column on the workspace. // largest row/tallest column on the workspace.
@ -1546,11 +1550,10 @@ const Workspace = new Lang.Class({
return [rowSpacing, columnSpacing, padding]; return [rowSpacing, columnSpacing, padding];
}, },
_computeAllWindowSlots: function(windows) { _computeLayout: function(windows) {
let [rowSpacing, columnSpacing, padding] = this._getSpacingAndPadding(); let [rowSpacing, columnSpacing, padding] = this._getSpacingAndPadding();
let area = padArea(this._fullGeometry, padding); let area = padArea(this._fullGeometry, padding);
let layout = this._computeLayout(windows, area, rowSpacing, columnSpacing); return this._getBestLayout(windows, area, rowSpacing, columnSpacing);
return layout.strategy.computeWindowSlots(layout, area);
}, },
_onCloneSelected : function (clone, time) { _onCloneSelected : function (clone, time) {