[Kde-hardware-devel] Backlight control support

Kai Uwe Broulik kde at privat.broulik.de
Sat May 25 13:26:39 UTC 2013


Hi there,

I'm currently working on revamping the battery monitor and found that the 
algorithm that is supposed to hide brightness slider in case backlight 
controls are not supported in 4.11 doesn't work and always returns true 
leading the a sort of unchanged situation.
My new battery monitor tries to be a lot cleaner and so having proper 
backlight support detection is important for that. Especially since it will 
have keyboard backlight support too, and having two useless sliders is bad. 
(Okay, keyboard backlight afaik is properly detected).

My analysis shows:
Problem 1)
In powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp always does
controls.insert(QLatin1String("LVDS1"), Screen);
no matter whether the checks a bit earlier have failed. In the action itself 
the isSupported() function checks whether brightnessControlsList is empty, 
which is never the case because it alawys contains LVDS1.
Problem is also, if the brightness controls are not available, PowerDevil spam 
you with the "The profile foo tried to load action BrightnessControls which is 
a non-existent action.", so this message also needs fixing in this case.

Problem 2)
The power management engine just connects to the 
/org/kde/Solid/PowerManagement/Actions/BrightnessControls object. And it seems 
the connect call *always* returns true, even if the object doesn't even exist. 
So, the dataengine itself always says that backlight controls are available, 
regardless of Problem 1. (And also it won't notice if the controls become 
unavailable in the mean time or if they become available after plasma started 
for some reason)

Any comment or suggestion?

I did a few hacks and workarounds in the code mentioned above, it's inside the 
plasma/broulik/batterymonitor branch of kde-workspace. It does somewhat work 
but is definitly not something for production use or merging.

Greetings,
Kai Uwe


More information about the Kde-hardware-devel mailing list