[effects/fadedesktop] Port to explicit animate API

Summary: No behavioural changes

Test Plan:
Set a slow animation speed
Changed desktop

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15473
This commit is contained in:
David Edmundson 2018-09-14 10:09:22 +02:00
parent 9ebb7978de
commit 4ecbacff77

View file

@ -40,9 +40,24 @@ effects['desktopChanged(int,int)'].connect(function(oldDesktop, newDesktop) {
continue;
}
if (w.desktop == oldDesktop) {
effect.animate(w, Effect.Opacity, duration, 0.0);
animate({
window: w,
duration: duration,
animations: [{
type: Effect.Opacity,
to: 0.0
}]
});
} else {
effect.animate(w, Effect.Opacity, duration, w.opacity, 0.0);
animate({
window: w,
duration: duration,
animations: [{
type: Effect.Opacity,
to: w.opacity,
from: 0.0
}]
});
}
}
});