Skip to content

Per-display brightness D-Bus API and applet GUI

Jakob Petsovits requested to merge work/jpetso/brightness-dbus-per-display into master

Fix #19 (closed) by exposing a new D-Bus API and adapting the Brightness applet to use this new API. In other words, make the applet to show brightness controls for each display separately. Check out individual commit messages, and discussion threads below, for more details.

Many changes on the way to making this happen have already been merged in separate MRs. Three more "dependency" commits are included in here (one for KWinBrightness priority order, one for using "Built-in Screen" as label for KWinBrightness, one for introducing adjustBrightnessRatio()) whereas the meat of the MR lies in the introduction of the D-Bus API as well as the applet switching over completely from the old BrightnessControl to the new ScreenBrightnessControl API.

CC @nclarius, @zamundaaa, @nicolasfella

Test plan

Update libkscreen (for libkscreen!196 (merged)), plasma-workspace (for plasma-workspace!4616 (merged)) and plasma-desktop (for plasma-desktop!2449 (merged)) to make use of the recently merged OSD API specifically for (multi-)screen brightness changes.

  • Hover over the applet icon to show the tooltip (test with one display as well as with multiple displays).
  • Click on the applet icon to show the updated UI for multiple brightness-adjustible displays.
    • Display names are provided by KWin in Wayland, and by PowerDevil/ddcutil in X11.
  • Drag brightness sliders to test brightness changes per display.
  • Use mouse scroll wheel to test regular (5%) step changes.
    • Icon scrolling as well as brightness keys now use the same logic, and will change brightness for all displays.
    • Verify that the OSD will show the percentage of the adjusted display(s) when the applet is closed, and no OSD appears when the applet is showing.
    • Keep scrolling after one display hits one end of the slider: other displays will keep getting brighter/darker as you keep scrolling.
      • When scrolling back, the original difference between displays will be preserved.
  • Use mouse scroll wheel + Shift to test small (1%) step changes.
  • Use touchpad scrolling (very slow) to test continuous changes with arbitrarily small values.
  • Plug and unplug some monitors to verify that the UI will adapt to changes on the fly.

Screenshots

On X11 (backlight & DDC backends directly) On Wayland (KWin backend)
2024-07-17.brightness-applet-displays-x11 2024-07-17.brightness-applet-displays-wayland
2024-07-17.brightness-applet-tooltip-wayland

Bugs fixed

BUG: 431994 BUG: 470107 BUG: 481927 CCBUG: 353032 CCBUG: 487812

Edited by Jakob Petsovits

Merge request reports

Loading