Commit 3fcce012 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[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
parent 913f92ae
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment