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
This commit is contained in:
Florian Müllner 2016-02-22 18:11:56 +01:00
parent 4c29604e1e
commit d8960b396b

View File

@ -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) {