[gnome-shell/wip/swarm: 118/126] viewSelector: Only animate with swarm on special cases



commit 33f2864abdd4d412474d346a13b3774f7d65267a
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Tue Jun 17 20:58:50 2014 +0200

    viewSelector: Only animate with swarm on special cases

 js/ui/viewSelector.js |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 9764848..26a4d77 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -393,10 +393,10 @@ const ViewSelector = new Lang.Class({
                          });
     },
 
-    _animateIn: function(page) {
+    _animateIn: function(page, oldPage) {
         page.show();
 
-        if (page == this._appsPage) {
+        if (page == this._appsPage && oldPage == this._workspacesPage) {
             // Restore opacity of the page, since we could took the opacity
             // on _fadePageIn if we didn't use swarm animation to animate out.
             page.opacity = 255;
@@ -406,8 +406,10 @@ const ViewSelector = new Lang.Class({
         }
     },
 
-    _animateOut: function(page, onComplete) {
-        if (page == this._appsPage) {
+    _animateOut: function(page, newPage, onComplete) {
+        if (page == this._appsPage &&
+            newPage == this._workspacesPage &&
+            !Main.overview.animationInProgress) {
             this.appDisplay.animate(IconGrid.AnimationDirection.OUT,
                                     onComplete);
         } else {
@@ -435,11 +437,11 @@ const ViewSelector = new Lang.Class({
         let animateActivePage = Lang.bind(this,
             function() {
                 this._hidePageAndSyncEmpty(oldPage);
-                this._animateIn(this._activePage);
+                this._animateIn(page, oldPage);
             });
 
         if (oldPage)
-            this._animateOut(oldPage, animateActivePage)
+            this._animateOut(oldPage, page, animateActivePage)
         else
             animateActivePage();
     },


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