[gnome-shell] [overview] Fix positioning of single small windows



commit 0e9c47bd56c34c595f5514736e496d1b61ef21da
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sun May 9 14:18:42 2010 +0200

    [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 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 508471e..014df8c 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];
     },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]