From 0b9597975170983f04885d617840013fd9b74e83 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 22 Sep 2021 14:33:09 +0300 Subject: [PATCH] kcm/compositing: Don't reset animation speed to default value when running in plasma When running in plasma, the animation speed slider is in General Behavior KCM. The Defaults button should not reset the animation speed slider because it's hidden. BUG: 442600 --- src/kcmkwin/kwincompositing/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/kcmkwin/kwincompositing/main.cpp b/src/kcmkwin/kwincompositing/main.cpp index e5fe6aebe5..9b915d1899 100644 --- a/src/kcmkwin/kwincompositing/main.cpp +++ b/src/kcmkwin/kwincompositing/main.cpp @@ -253,8 +253,10 @@ void KWinCompositingKCM::defaults() // unmanaged widgets m_form.backend->setCurrentIndex(CompositingTypeIndex::OPENGL20_INDEX); - // corresponds to 1.0 seconds in s_animationMultipliers - m_form.animationDurationFactor->setValue(3); + if (!isRunningPlasma()) { + // corresponds to 1.0 seconds in s_animationMultipliers + m_form.animationDurationFactor->setValue(3); + } } void KWinCompositingKCM::save() @@ -274,8 +276,10 @@ void KWinCompositingKCM::save() m_settings->setBackend(backend); m_settings->setGlCore(glCore); - const auto animationDuration = s_animationMultipliers[m_form.animationDurationFactor->value()]; - m_settings->setAnimationDurationFactor(animationDuration); + if (!isRunningPlasma()) { + const auto animationDuration = s_animationMultipliers[m_form.animationDurationFactor->value()]; + m_settings->setAnimationDurationFactor(animationDuration); + } m_settings->save(); KCModule::save();