[effects/translucency] Cancel existing animations before starting new

Summary:
It can happen that startAnimation is invoked multiple times for a
window. In case it was invoked a second time the previous animation was
not cancelled. This resulted in the set-animation to never end. When
closing a window, it would stay around as a translucent, non-interactive
window zombie.

This change ensures that existing animations get cancelled.

BUG: 342716
FIXED-IN: 5.8.3

Test Plan: Tested through autotest and manually.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3190
This commit is contained in:
Martin Gräßlin 2016-10-28 14:42:57 +02:00
parent 37067f538e
commit 94c5704af7
2 changed files with 3 additions and 3 deletions

View file

@ -238,12 +238,9 @@ void TranslucencyTest::testDialogClose()
QVERIFY(windowDeletedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
if (windowDeletedSpy.isEmpty()) {
QEXPECT_FAIL("", "BUG 342716", Continue);
QVERIFY(windowDeletedSpy.wait());
}
QEXPECT_FAIL("", "BUG 342716", Continue);
QCOMPARE(windowDeletedSpy.count(), 1);
QEXPECT_FAIL("", "BUG 342716", Continue);
QTRY_VERIFY(!m_translucencyEffect->isActive());
xcb_destroy_window(c.data(), w);
c.reset();

View file

@ -78,6 +78,9 @@ var translucencyEffect = {
to: value / 100.0
}]
});
if (window.translucencyWindowTypeAnimation !== undefined) {
cancel(window.translucencyWindowTypeAnimation);
}
window.translucencyWindowTypeAnimation = ids;
}
};