[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
This commit is contained in:
Adel Gadllah 2010-05-09 14:18:42 +02:00
parent 2ca1fe3254
commit 0e9c47bd56

View File

@ -1023,8 +1023,13 @@ Workspace.prototype = {
(desiredHeight - buttonOuterHeight - captionHeight) / rect.height, (desiredHeight - buttonOuterHeight - captionHeight) / rect.height,
1.0 / this.scale); 1.0 / this.scale);
x = xCenter - 0.5 * scale * rect.width; x = Math.floor(xCenter - 0.5 * scale * rect.width);
y = y + height - rect.height * scale - captionHeight;
// 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]; return [x, y, scale];
}, },