Closed mttmartin closed 2 months ago
https://github.com/pop-os/cosmic-settings-daemon/pull/33 added the max percentage. This requires a bit more work from the client, as you say, instead of converting here. But also allows something like the slider in cosmic-applet-battery to know what the max brightness and step size is (used in https://github.com/pop-os/cosmic-applets/pull/492).
We still want to consider changes to the brightness interface in the future, particular if we want to support multiple/external brightness devices (https://github.com/pop-os/cosmic-applets/issues/428), but I think we don't need this particular API for the time being.
Currently
BrightnessDevice
operates with the raw values fromsysfs
and exposes them to other components via zbus. This can lead to some unexpected behaviour (e.g. when read fromcosmic-osd
), since the brightness values are not normalised by the maximum brightness there. This was reported in an issue here: https://github.com/pop-os/cosmic-applets/issues/484This PR modifies
BrightnessDevice
so that it exposes brightness in percent to the outside, so any caller does not have to take into account the maximum brightness and normalise the value themselves.