daemon: Disable KWin brightness control integration by default
Not on master, targeted to Plasma/6.2
only at Xaver Hugl's request.
Brightness controls owned by KWin have proven controversial,
mostly because it doesn't currently take any pre-configured
hardware brightness values into account on startup or when the
user adjusts brightness in their OSD menu. As a result, a sizeable
number of users have resorted to setting POWERDEVIL_NO_DDCUTIL=1
.
Disabling KWin brightness control integration is a first step toward stopping the bleeding. After this, pre-configured hardware brightness will mostly be respected again. (PowerDevil itself contains one more "non-requested" brightness write in DDCutilDisplay, which gets performed after the monitor wakes up. We'll need to deal with that one separately.)
In order to work as expected, PowerDevil cannot completely ignore KWin's Wayland protocols. If we simply omitted our display findings, KWin configurations from before commit 4f18aae6 would use the previously stored hardware brightness as software brightness, and dim the screen more than necessary, without obvious recourse.
Instead, we continue to announce our external brightness devices to KWin, but ignore KWin's listings and requests when it arrives back at the PowerDevil service. This ensures that KWin will set software brightness to 1.0, and adds a flag to KWin's output config that will later allow us to leave the brightness device unannounced.
KWin brightness control integration is only disabled for SDR outputs.
HDR brightness will continue to be exposed in the brightness applet.
SDR brightness control integration can be manually enabled by setting
the environment variable POWERDEVIL_USE_KWIN_SDR_BRIGHTNESS=1
until we have sufficiently addressed user concerns.