Skip to content

daemon: Expose brightnessMin and knownSafeBrightnessMin to D-Bus

Implementing the idea outlined in plasma-workspace!4117 (comment 923164). CC @nclarius for your testing pleasure - or horror, depending. I briefly tested that existing brightness adjustments still work on my laptop display, bug that doesn't mean much without the new code paths being exercised. Maybe a version of plasma-workspace!4117 modified to make use of these new D-Bus methods can actually put this branch through the ringer.

Depends on MR !350 (which is included in the branch). Hence this MR has the other MR's work branch set as its merge target, so that only the diff of the feature addition commit gets shown here. In practice, we'll want !350 to get reviewed & merged into master first. No configurability yet for this patch, as mentioned in the below commit message, but we can add that as a next step.


Instead of hardcoding minimum brightness to 1 for all screens, we add a function knownSafeMinBrightness() to the DisplayBrightness interface and query it from ScreenBrightnessController. Backlight displays use a hardcoded minimum of 1 as before, whereas DDC/CI displays now default to a minimum of 0 again. We are not aware of external monitors turning off the backlight when set 0 as brightness value.

ScreenBrightnessController exposes knownSafeMinBrightness() directly (only that of the first known display, until we get per-display APIs) and also adds an extra minBrightness() function. The latter is meant to change at runtime in the future, based on user configuration. Configurability of minBrightness() is not yet implemented.

Both methods are added to the D-Bus interface of BacklightControl, for subsequent use by the brightness applet.

Merge request reports