[gnome-shell] windowManager: Split _shouldAnimate() into two functions



commit a04350f7ce62915f13326b612235c85bae241bc3
Author: Florian MÃllner <fmuellner gnome org>
Date:   Sat Jul 14 02:43:07 2012 +0200

    windowManager: Split _shouldAnimate() into two functions
    
    ... instead of using an optional parameter.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674499

 js/ui/windowManager.js |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 1d5f204..59aa1f3 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -161,12 +161,14 @@ const WindowManager = new Lang.Class({
         this._animationBlockCount = Math.max(0, this._animationBlockCount - 1);
     },
 
-    _shouldAnimate : function(actor) {
-        if (Main.overview.visible || this._animationBlockCount > 0)
-            return false;
-        if (actor && (actor.meta_window.get_window_type() != Meta.WindowType.NORMAL))
+    _shouldAnimate: function() {
+        return !(Main.overview.visible || this._animationBlockCount > 0);
+    },
+
+    _shouldAnimateActor: function(actor) {
+        if (!this._shouldAnimate())
             return false;
-        return true;
+        return actor.meta_window.get_window_type() == Meta.WindowType.NORMAL;
     },
 
     _removeEffect : function(list, actor) {
@@ -179,7 +181,7 @@ const WindowManager = new Lang.Class({
     },
 
     _minimizeWindow : function(shellwm, actor) {
-        if (!this._shouldAnimate(actor)) {
+        if (!this._shouldAnimateActor(actor)) {
             shellwm.completed_minimize(actor);
             return;
         }
@@ -340,7 +342,7 @@ const WindowManager = new Lang.Class({
             shellwm.completed_map(actor);
             return;
         }
-        if (!this._shouldAnimate(actor)) {
+        if (!this._shouldAnimateActor(actor)) {
             shellwm.completed_map(actor);
             return;
         }



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