Commit 21f2764f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Nate Graham
Browse files

[backlighthelper] Don't touch brightness when animation isn't running

For some reason when changing screen brightness to zero, I get a valueChanged
of zero before the animation starts, leading to an annoying flicker.
parent 23e07320
......@@ -63,7 +63,10 @@ void BacklightHelper::init()
m_anim.setEasingCurve(QEasingCurve::InOutQuad);
connect(&m_anim, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) {
writeBrightness(value.toInt());
// When animating to zero, it emits a value change to 0 before starting the animation...
if (m_anim.state() == QAbstractAnimation::Running) {
writeBrightness(value.toInt());
}
});
m_isSupported = true;
......
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