Skip to content

daemon: Refactor internal brightness step adjustment API

Jakob Petsovits requested to merge work/jpetso/brightness-steps-refactor into master

Split out of !361 (merged) to avoid piling all the changes into that MR.


As we move toward multi-display support, the existing screenBrightnessKeyPressed() API isn't good enough anymore. Brightness changes could come from either D-Bus API and for any display, so it's not enough to check for a function result with the new brightness of just a single display.

Instead, provide a new adjustBrightnessStep() function that does not return any values, but instead forwards an IndicatorHint enum value to brightness change signals. This allows us to show the OSD from BrightnessControl's brightness change handler, and keep it working when another action requests the percentage indicator to be shown.

In the process, also clean up some of the naming in BrightnessLogic.

Merge request reports

Loading