Review Request: Make brightness Fn keys work and add an OSD

Felix Geyer debfx-kde at
Fri Oct 23 14:08:40 BST 2009

This is an automatically generated e-mail. To reply, visit:

Review request for kdelibs.


Currently the brightness Fn keys don't work on KDE when they aren't handled by the hardware/kernel(?).
This patch detects if that's the case by comparing a cached brightness value with the current brightness.
If they are the same the Fn keys aren't handled by the hardware, so PowerDevil adjusts the brightness accordingly.
To achieve this Solid sends PowerDevil a dbus message on every brightness change (notifyOfBrightnessChange(int brightness)).

PowerDevil itself provides the dbus signal brightnessChanged(int brightness, bool byFnKey) which the battery applet connects to.
The battery applet only displays an OSD (code copied from KMix) if the brightness change originated from an Fn key press.

This depends on review request #1950 "Add new X11 Qt keys to KKeyServer":


  trunk/KDE/kdebase/workspace/libs/solid/control/powermanager.cpp 1039431 
  trunk/KDE/kdebase/workspace/plasma/generic/applets/battery/battery.h 1039431 
  trunk/KDE/kdebase/workspace/plasma/generic/applets/battery/battery.cpp 1039431 
  trunk/KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.h 1039431 
  trunk/KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.cpp 1039431 
  trunk/KDE/kdebase/workspace/powerdevil/daemon/org.kde.PowerDevil.xml 1039431 



This patch has been applied to Kubuntu karmic which will be released in a few days.
So far I'm only aware of one machine where this patch causes trouble: MSI Wind U100.
That laptop (or maybe the kernel?) seems to generate brightness up/down key events on every brightness change causing a brightness setting loop.
I think it's not possible to detect this automatically, but there is a HAL property which has been introduced for exactly that purpose: laptop_panel.brightness_in_hardware.
Setting this property to true on the MSI Wind seems to fix it.



More information about the kde-core-devel mailing list