Quantcast
Channel: PowerDevil activity
Viewing all articles
Browse latest Browse all 1733

Xaver Hugl approved merge request !359: daemon: Only external brightness change signals from DisplayBrightness at Plasma / PowerDevil

$
0
0

Builds on top of !352. Part of the ongoing effort of allowing per-display brightness controls (#19).

DisplayBrightness implementations have so far needed to emita brightnessChanged signal for ScreenBrightnessController topick up on, both as a result of explicit setBrightness() callsand if they pick up on external brightness changes.

This is awkward for DisplayBrightness to implement. They can emitthe brightnessChanged signal immediately when setBrightness()is called, which is strictly speaking a lie, or they can emit itonly once brightness has actually been set, at the risk of causinga UI component to reset its value when that component has alreadymoved on to a different value instead.

Neither is great, so let's scrap the brightnessChanged signalthat follows setBrightness(). ScreenBrightnessController can assumethat the brightness gets changed as requested, and will take overthe responsibility of emitting signals from within its ownsetBrightness() function. If anything goes wrong, DisplayBrightnessimplementations can notify the controller about the failure.

What remains is a a signal purely for changes that the controllerdid not ask for. We call this externalBrightnessChangeObserved.

Nothing changes for users of ScreenBrightnessController, for thetime being. However, this change paves the way for a laterintroduction of source client/context parameters without havingto burden DisplayBrightness implementations with forwarding those.It might also make backlight brightness sliders a tad snappier.


Viewing all articles
Browse latest Browse all 1733

Trending Articles