[effects/minimizeanimation] Don't reset timeline

Summary:
Resetting timeline while animating a window causes some visual "glitches",
see videos below. Even though we can't use `QTimer::toggleDirection`,
that's safe to delete code which resets timeline because `prePaintScreen`
figures out correct direction of the timeline.

Before

{F5809862, layout=center, size=full}

After

{F5809898, layout=center, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12254
This commit is contained in:
Vlad Zagorodniy 2018-04-20 21:15:23 +03:00
parent 913f92ae9a
commit 3fcce012c0

View file

@ -125,30 +125,26 @@ void MinimizeAnimationEffect::slotWindowMinimized(EffectWindow* w)
{
if (effects->activeFullScreenEffect())
return;
QTimeLine *timeline;
if (mTimeLineWindows.contains(w)) {
timeline = mTimeLineWindows[w];
} else {
timeline = new QTimeLine(animationTime(250), this);
if (!mTimeLineWindows.contains(w)) {
auto *timeline = new QTimeLine(animationTime(250), this);
timeline->setCurrentTime(0);
timeline->setCurveShape(QTimeLine::EaseInOutCurve);
mTimeLineWindows.insert(w, timeline);
}
timeline->setCurveShape(QTimeLine::EaseInCurve);
timeline->setCurrentTime(0.0);
}
void MinimizeAnimationEffect::slotWindowUnminimized(EffectWindow* w)
{
if (effects->activeFullScreenEffect())
return;
QTimeLine *timeline;
if (mTimeLineWindows.contains(w)) {
timeline = mTimeLineWindows[w];
} else {
timeline = new QTimeLine(animationTime(250), this);
if (!mTimeLineWindows.contains(w)) {
auto *timeline = new QTimeLine(animationTime(250), this);
timeline->setCurrentTime(timeline->duration());
timeline->setCurveShape(QTimeLine::EaseInOutCurve);
mTimeLineWindows.insert(w, timeline);
}
timeline->setCurveShape(QTimeLine::EaseInOutCurve);
timeline->setCurrentTime(timeline->duration());
}
bool MinimizeAnimationEffect::isActive() const