Skip to content

applets/brightness: Always show displays in order of the D-Bus listing

Note: I picked 6.3 as milestone given that it's a low-impact bug (no reports on bugs.kde.org either) and the change introduces a little bit of extra code. If it works out well and people like the change enough, I wouldn't take issue with cherry-picking this to Plasma/6.2 either.


Previously, the applet's brightness sliders were initialized with the D-Bus listing, but subsequent display additions would always be added at the end. This is mostly fine, but not always.

After this refactoring, the display model is fully in control of determining its row order without help from the main plugin class. Its rows are the intersection of two collections of source data:

  • The list of known display names, a direct mirror of the latest list of display names on the screen brightness D-Bus interface.
  • A hashmap of display data, for displays that were queried.

Not every known display name necessarily has a corresponding row element, but the order of exposed row elements matches the list of known display names.

Display data is only kept for known display names, unassociated data is removed when names are updated.

This change also makes the plugin more robust against async/coroutine code execution ordering bugs.

Merge request reports

Loading