From 3c455c1772a0cab18f6313ddf407bbde2f2f48b0 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 8 Sep 2023 13:28:28 +0900 Subject: 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 --- kmilo/generic/generic_monitor.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); + } } } } -- cgit v1.2.1