From 94c5704af74db5e0f8e86f0c572e4e11453e7002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 28 Oct 2016 14:42:57 +0200 Subject: [PATCH] [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 --- autotests/integration/effects/translucency_test.cpp | 3 --- effects/translucency/package/contents/code/main.js | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autotests/integration/effects/translucency_test.cpp b/autotests/integration/effects/translucency_test.cpp index 92f15efe93..428026d48c 100644 --- a/autotests/integration/effects/translucency_test.cpp +++ b/autotests/integration/effects/translucency_test.cpp @@ -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(); diff --git a/effects/translucency/package/contents/code/main.js b/effects/translucency/package/contents/code/main.js index f6468a946e..69c051187d 100644 --- a/effects/translucency/package/contents/code/main.js +++ b/effects/translucency/package/contents/code/main.js @@ -78,6 +78,9 @@ var translucencyEffect = { to: value / 100.0 }] }); + if (window.translucencyWindowTypeAnimation !== undefined) { + cancel(window.translucencyWindowTypeAnimation); + } window.translucencyWindowTypeAnimation = ids; } };