diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -185,12 +185,11 @@ void ScriptedEffectsTest::cleanup() { Test::destroyWaylandConnection(); - auto *e = static_cast(effects); - while (!e->loadedEffects().isEmpty()) { - const QString effect = e->loadedEffects().first(); - e->unloadEffect(effect); - QVERIFY(!e->isEffectLoaded(effect)); - } + + auto effectsImpl = static_cast(effects); + effectsImpl->unloadAllEffects(); + QVERIFY(effectsImpl->loadedEffects().isEmpty()); + KWin::VirtualDesktopManager::self()->setCurrent(1); } diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -96,12 +96,10 @@ void WobblyWindowsShadeTest::cleanup() { Test::destroyWaylandConnection(); - EffectsHandlerImpl *e = static_cast(effects); - while (!e->loadedEffects().isEmpty()) { - const QString effect = e->loadedEffects().first(); - e->unloadEffect(effect); - QVERIFY(!e->isEffectLoaded(effect)); - } + + auto effectsImpl = static_cast(effects); + effectsImpl->unloadAllEffects(); + QVERIFY(effectsImpl->loadedEffects().isEmpty()); } struct XcbConnectionDeleter