[effects/fadedesktop] Set animation as a fullscreen effect

Summary:
This lets other effects know whether they should inhibit or not which
reduces
visual glitches of overlapping animations.

BUG: 321201
FIXED-IN: 5.15.0

Test Plan: Switched desktops, they still faded

Reviewers: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15474
This commit is contained in:
David Edmundson 2018-10-10 11:45:13 +01:00
parent 2569768074
commit b1b1360ec3

View file

@ -27,8 +27,11 @@ effect.configChanged.connect(function() {
loadConfig();
});
effects['desktopChanged(int,int)'].connect(function(oldDesktop, newDesktop) {
if (effects.hasActiveFullScreenEffect && !effect.isActiveFullScreenEffect) {
return;
}
var stackingOrder = effects.stackingOrder;
for (var i=0; i<stackingOrder.length; i++) {
for (var i = 0; i < stackingOrder.length; i++) {
var w = stackingOrder[i];
if (w.desktop != oldDesktop && w.desktop != newDesktop) {
continue;
@ -45,7 +48,8 @@ effects['desktopChanged(int,int)'].connect(function(oldDesktop, newDesktop) {
duration: duration,
animations: [{
type: Effect.Opacity,
to: 0.0
to: 0.0,
fullScreen: true
}]
});
} else {
@ -55,9 +59,20 @@ effects['desktopChanged(int,int)'].connect(function(oldDesktop, newDesktop) {
animations: [{
type: Effect.Opacity,
to: 1.0,
from: 0.0
from: 0.0,
fullScreen: true
}]
});
}
}
});
effect.isActiveFullScreenEffectChanged.connect(function() {
var isActiveFullScreen = effect.isActiveFullScreenEffect;
var stackingOrder = effects.stackingOrder;
for (var i = 0; i < stackingOrder.length; i++) {
var w = stackingOrder[i];
w.setData(Effect.WindowForceBlurRole, isActiveFullScreen);
w.setData(Effect.WindowForceBackgroundContrastRole, isActiveFullScreen);
}
});