[gnome-shell] workspace: Do window slot computing in three steps



commit caaac9b9ecd2ad229644a3a10a42897a31898eb1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 25 21:40:13 2013 -0500

    workspace: Do window slot computing in three steps
    
    This ensures that we have the correct Y value when sorting
    windows.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694469

 js/ui/workspace.js | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index e8604b4..145411b 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -767,23 +767,30 @@ const LayoutStrategy = new Lang.Class({
 
         let slots = [];
 
+        // Do this in three parts.
+        let height = 0;
+        for (let i = 0; i < rows.length; i++) {
+            let row = rows[i];
+            height += row.height + this._rowSpacing;
+        }
+
+        height -= this._rowSpacing;
+
         let y = 0;
+
         for (let i = 0; i < rows.length; i++) {
             let row = rows[i];
             row.x = area.x + (area.width - row.width) / 2;
-            row.y = area.y + y;
+            row.y = area.y + y + (area.height - height) / 2;
             y += row.height + this._rowSpacing;
+
             row.windows.sort(Lang.bind(this, function(a, b) {
                 return this._getDistance(row, a.realWindow) - this._getDistance(row, b.realWindow);
             }));
         }
 
-        let height = y - this._rowSpacing;
-        let baseY = (area.height - height) / 2;
-
         for (let i = 0; i < rows.length; i++) {
             let row = rows[i];
-            row.y += baseY;
             let x = row.x;
             for (let j = 0; j < row.windows.length; j++) {
                 let window = row.windows[j];


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