From 0e9c47bd56c34c595f5514736e496d1b61ef21da Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sun, 9 May 2010 14:18:42 +0200 Subject: [PATCH] [overview] Fix positioning of single small windows A single window that does not need to be scaled down, should be centered and not placed at the bottom. To avoid blurryness window positions should be pixel aligned. https://bugzilla.gnome.org/show_bug.cgi?id=617827 --- js/ui/workspace.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 508471ee8..014df8c6f 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -1023,8 +1023,13 @@ Workspace.prototype = { (desiredHeight - buttonOuterHeight - captionHeight) / rect.height, 1.0 / this.scale); - x = xCenter - 0.5 * scale * rect.width; - y = y + height - rect.height * scale - captionHeight; + x = Math.floor(xCenter - 0.5 * scale * rect.width); + + // We want to center the window in case we have just one + if (metaWindow.get_workspace().n_windows == 1) + y = Math.floor(yCenter * global.screen_height - 0.5 * scale * rect.height); + else + y = Math.floor(y + height - rect.height * scale - captionHeight); return [x, y, scale]; },