[gnome-shell] windowManager: Add mechanism to block animations



commit 76d788a186cd4ba959067882084cd15db426dae8
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Wed Feb 16 21:05:20 2011 +0100

    windowManager: Add mechanism to block animations
    
    Add an API to allow blocking animations in situations where
    they aren't desireable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=642188

 js/ui/windowManager.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index deca70e..a10608f 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -93,6 +93,8 @@ WindowManager.prototype = {
 
         this._dimmedWindows = [];
 
+        this._animationBlockCount = 0;
+
         this._switchData = null;
         this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
         this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) {
@@ -139,8 +141,16 @@ WindowManager.prototype = {
             this._shellwm.connect('keybinding::' + keybinding, handler);
     },
 
+    blockAnimations: function() {
+        this._animationBlockCount++;
+    },
+
+    unblockAnimations: function() {
+        this._animationBlockCount = Math.max(0, this._animationBlockCount - 1);
+    },
+
     _shouldAnimate : function(actor) {
-        if (Main.overview.visible)
+        if (Main.overview.visible || this._animationsBlocked > 0)
             return false;
         if (actor && (actor.meta_window.get_window_type() != Meta.WindowType.NORMAL))
             return false;



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