Reposition windows when scaling workspaces
The scale of windows within a workspace is determined by the scale of the workspace since we never scale a window bigger than the original size of the window. So when we rescale workspaces we have to rerun Workspace.positionWindows(). http://bugzilla.gnome.org/show_bug.cgi?id=591124
This commit is contained in:
parent
4830808d2f
commit
06d17e08c0
@ -431,7 +431,7 @@ Workspace.prototype = {
|
||||
// Reposition all windows in their zoomed-to-overlay position. if workspaceZooming
|
||||
// is true, then the workspace is moving at the same time and we need to take
|
||||
// that into account
|
||||
_positionWindows : function(workspaceZooming) {
|
||||
positionWindows : function(workspaceZooming) {
|
||||
let global = Shell.Global.get();
|
||||
|
||||
for (let i = 1; i < this._windows.length; i++) {
|
||||
@ -547,7 +547,7 @@ Workspace.prototype = {
|
||||
clone.destroy();
|
||||
icon.destroy();
|
||||
|
||||
this._positionWindows(false);
|
||||
this.positionWindows(false);
|
||||
this.updateRemovable();
|
||||
},
|
||||
|
||||
@ -584,7 +584,7 @@ Workspace.prototype = {
|
||||
clone.actor.set_scale (scale, scale);
|
||||
}
|
||||
|
||||
this._positionWindows(false);
|
||||
this.positionWindows(false);
|
||||
this.updateRemovable();
|
||||
},
|
||||
|
||||
@ -610,7 +610,7 @@ Workspace.prototype = {
|
||||
});
|
||||
|
||||
// Likewise for each of the windows in the workspace.
|
||||
this._positionWindows(true);
|
||||
this.positionWindows(true);
|
||||
},
|
||||
|
||||
// Animates the return from overlay mode
|
||||
@ -1120,6 +1120,14 @@ Workspaces.prototype = {
|
||||
this._workspaces[w].resizeToGrid(oldScale);
|
||||
}
|
||||
|
||||
if (newScale != oldScale) {
|
||||
// The workspace scale affects window size/positioning because we clamp
|
||||
// window size to a 1:1 ratio and never scale them up
|
||||
let existingWorkspaces = Math.min(oldNumWorkspaces, newNumWorkspaces);
|
||||
for (let w = 0; w < existingWorkspaces; w++)
|
||||
this._workspaces[w].positionWindows(false);
|
||||
}
|
||||
|
||||
if (newNumWorkspaces > oldNumWorkspaces) {
|
||||
// Slide new workspaces in from offscreen
|
||||
for (let w = oldNumWorkspaces; w < newNumWorkspaces; w++)
|
||||
|
Loading…
Reference in New Issue
Block a user