From a9505d0426bfc092983bb0023425280a63f3ed77 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 11 Mar 2011 19:03:20 -0500 Subject: [PATCH] workspaceView: Make sure to scale the workspace proportionally Commit 0207f1f29b776ae5f8f59321284f1adc2f85159e landed a new way of zooming, but was causing all sorts of window positioning weirdness because the positions were supposed to be working against a proportional workspace. https://bugzilla.gnome.org/show_bug.cgi?id=644542 --- js/ui/workspacesView.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 3f79ec8c3..2d63ed1b6 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -708,8 +708,11 @@ WorkspacesDisplay.prototype = { if (!this.workspacesView) return; - let width = this.actor.allocation.x2 - this.actor.allocation.x1; - let height = this.actor.allocation.y2 - this.actor.allocation.y1; + let fullWidth = this.actor.allocation.x2 - this.actor.allocation.x1; + let fullHeight = this.actor.allocation.y2 - this.actor.allocation.y1; + + let width = fullWidth; + let height = fullHeight; let [controlsMin, controlsNatural] = this._controls.get_preferred_width(height); let controlsVisible = this._controls.get_theme_node().get_length('visible-width'); @@ -728,6 +731,9 @@ WorkspacesDisplay.prototype = { x += controlsVisible; } + height = (fullHeight / fullWidth) * width; + y += (fullHeight - height) / 2; + this.workspacesView.setGeometry(x, y, width, height); },