[gnome-shell] windowManager: Only animate dimming changes when necessary



commit d8960b396b6e69cbb1193926d6d921bf0e609e6c
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Feb 22 18:11:56 2016 +0100

    windowManager: Only animate dimming changes when necessary
    
    Now that we no longer skip dimming/undimming windows while showing
    the overview, we can still save a bit of work by changing the dimming
    without animation while the window is hidden.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762475

 js/ui/windowManager.js |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index a36a71f..bb54d83 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1367,11 +1367,14 @@ const WindowManager = new Lang.Class({
         let dimmer = getWindowDimmer(actor);
         if (!dimmer)
             return;
-        Tweener.addTween(dimmer,
-                         { dimFactor: 1.0,
-                           time: DIM_TIME,
-                           transition: 'linear'
-                         });
+        if (this._shouldAnimate())
+            Tweener.addTween(dimmer,
+                             { dimFactor: 1.0,
+                               time: DIM_TIME,
+                               transition: 'linear'
+                             });
+        else
+            dimmer.dimFactor = 1.0;
     },
 
     _undimWindow: function(window) {
@@ -1381,10 +1384,13 @@ const WindowManager = new Lang.Class({
         let dimmer = getWindowDimmer(actor);
         if (!dimmer)
             return;
-        Tweener.addTween(dimmer,
-                         { dimFactor: 0.0,
-                           time: UNDIM_TIME,
-                           transition: 'linear' });
+        if (this._shouldAnimate())
+            Tweener.addTween(dimmer,
+                             { dimFactor: 0.0,
+                               time: UNDIM_TIME,
+                               transition: 'linear' });
+        else
+            dimmer.dimFactor = 0.0;
     },
 
     _mapWindow : function(shellwm, actor) {


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