[gnome-shell/wip/workspace: 1/9] workspace: Punt the geometry-fizzling-out logic here



commit 9b736a1909d2341c37febee939f9ba5a504df5d3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 11 10:41:54 2013 -0400

    workspace: Punt the geometry-fizzling-out logic here

 js/ui/workspace.js      |   19 +++++++++++++++++++
 js/ui/workspacesView.js |   19 -------------------
 2 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 35dfb29..0d66930 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -908,6 +908,19 @@ function padArea(area, padding) {
     };
 }
 
+function rectEqual(one, two) {
+    if (one == two)
+        return true;
+
+    if (!one || !two)
+        return false;
+
+    return (one.x == two.x &&
+            one.y == two.y &&
+            one.width == two.width &&
+            one.height == two.height);
+}
+
 /**
  * @metaWorkspace: a #Meta.Workspace, or null
  */
@@ -983,11 +996,17 @@ const Workspace = new Lang.Class({
     },
 
     setFullGeometry: function(geom) {
+        if (rectEqual(this._fullGeometry, geom))
+            return;
+
         this._fullGeometry = geom;
         this._recalculateWindowPositions(WindowPositionFlags.NONE);
     },
 
     setActualGeometry: function(geom) {
+        if (rectEqual(this._actualGeometry, geom))
+            return;
+
         this._actualGeometry = geom;
 
         if (this._actualGeometryLater)
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index f4de48b..758ae2e 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -23,19 +23,6 @@ const MAX_WORKSPACES = 16;
 
 const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides';
 
-function rectEqual(one, two) {
-    if (one == two)
-        return true;
-
-    if (!one || !two)
-        return false;
-
-    return (one.x == two.x &&
-            one.y == two.y &&
-            one.width == two.width &&
-            one.height == two.height);
-}
-
 const WorkspacesView = new Lang.Class({
     Name: 'WorkspacesView',
 
@@ -149,9 +136,6 @@ const WorkspacesView = new Lang.Class({
     },
 
     setFullGeometry: function(geom) {
-        if (rectEqual(this._fullGeometry, geom))
-            return;
-
         this._fullGeometry = geom;
 
         for (let i = 0; i < this._workspaces.length; i++)
@@ -159,9 +143,6 @@ const WorkspacesView = new Lang.Class({
     },
 
     setActualGeometry: function(geom) {
-        if (rectEqual(this._actualGeometry, geom))
-            return;
-
         this._actualGeometry = geom;
 
         for (let i = 0; i < this._workspaces.length; i++)


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