summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-09-08 13:28:28 +0900
committerMichele Calgaro <[email protected]>2023-09-08 13:28:28 +0900
commit3c455c1772a0cab18f6313ddf407bbde2f2f48b0 (patch)
tree4d2a51307b3cd5cda723fa1626ae35a6fd0f5272
parent46c271a0c91e3bd1b018b1ff43be34a52f5c2cc8 (diff)
downloadtdeutils-3c455c1772a0cab18f6313ddf407bbde2f2f48b0.tar.gz
tdeutils-3c455c1772a0cab18f6313ddf407bbde2f2f48b0.zip
kmilo: improve brightness OSD feedback by displaying the actual value. This may differ from the set value on machines with few brightness steps capability
Signed-off-by: Michele Calgaro <[email protected]>
-rw-r--r--kmilo/generic/generic_monitor.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/kmilo/generic/generic_monitor.cpp b/kmilo/generic/generic_monitor.cpp
index 5751037..435b6df 100644
--- a/kmilo/generic/generic_monitor.cpp
+++ b/kmilo/generic/generic_monitor.cpp
@@ -303,7 +303,18 @@ void GenericMonitor::brightnessChange(int direction, int step)
{
tdepowersave->send("do_brightnessDown", step);
}
- _interface->displayProgress(i18n("Brightness"), brightnessLevel);
+
+ DCOPReply reply = tdepowersave->call("brightnessGet");
+ if (reply.isValid())
+ {
+ // Display real brightness value. This may differ from the set value
+ // on machines with few brightness steps.
+ _interface->displayProgress(i18n("Brightness"), (int)reply);
+ }
+ else
+ {
+ _interface->displayProgress(i18n("Brightness"), brightnessLevel);
+ }
}
}
}