Commit 053f92cc authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Nate Graham
Browse files

Honor animation brightness threshold also for sysfs helper

We should only animate the screen brightness if there are enough steps available
to make for a smooth transition. This check was forgotten for the new sysfs
brightness animation.

BUG: 426883
FIXED-IN: 5.20.0

(cherry picked from commit 6fd6179b)
parent eb339d06
......@@ -236,6 +236,12 @@ ActionReply BacklightHelper::setbrightness(const QVariantMap &args)
const int animationDuration = args.value(QStringLiteral("animationDuration")).toInt();
if (animationDuration <= 0) {
return ActionReply::SuccessReply();
......@@ -502,7 +502,9 @@ void PowerDevilUPowerBackend::setBrightness(int value, PowerDevil::BackendInterf
KAuth::Action action("org.kde.powerdevil.backlighthelper.setbrightness");
action.addArgument("brightness", value);
action.addArgument("animationDuration", PowerDevilSettings::brightnessAnimationDuration());
if (brightnessMax() >= PowerDevilSettings::brightnessAnimationThreshold()) {
action.addArgument("animationDuration", PowerDevilSettings::brightnessAnimationDuration());
auto *job = action.execute();
connect(job, &KAuth::ExecuteJob::result, this, [this, job, value] {
if (job->error()) {
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