ColorCorrect Library - for configuring KWin's native color correction (in particular Night Color)

Authored by romangg on May 21 2017, 10:36 PM.




With D5928 I've introduced Night Color in KWin. It was designed in a way to be fully configurable (while safe checking values) via DBus. Also it is supposed to get updated location data from workspace. To ease the configuration and provide the updated location data this library was written.


  • Abstracts away the DBus part and provides a generic adaptor to the compositor as QML object for that
    • Allows to stage values and send them at once as needed for KWin's atomic config changes
    • Informs about configuration changes
  • Provides also QML objects for other often used functionality in this context (sun calculator and a locator, i.e. an encapsulated connection to the location data service).
  • For automatic location updates the library provides a KDE Daemon Module, which gets the current location via such a locator object and sends it to KWin.
  • The library is named and structured in a way, such that it later can be extended with functionality to configure gamma values in general (normal color correction), i.e. as soon as the support for that has landed in KWin.

In theory the library could be used with other compositors as well, if they use a somewhat similar mechanism as KWin. In this case though the CompositorAdaptor class would need to be rewritten in parts, probably subclassed. A KCM in Plasma Desktop, which uses this library to configure KWin, is already written and its Diff will be uploaded soon.

Test Plan

Manually and auto tests.

Diff Detail

R120 Plasma Workspace
Lint Skipped
Unit Tests Skipped
romangg created this revision.May 21 2017, 10:36 PM
Restricted Application edited projects, added Plasma; removed KWin, Plasma on Wayland. · View Herald TranscriptMay 21 2017, 10:36 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
romangg updated this revision to Diff 14744.May 22 2017, 12:19 AM

Provide default values for configurable properties.

romangg updated this revision to Diff 14918.May 28 2017, 7:31 PM

Adapt to changed KWin DBus interface method names.

leezu added a subscriber: leezu.Oct 11 2017, 2:59 PM
romangg updated this revision to Diff 20970.Oct 19 2017, 11:06 AM

Merge current master.

davidedmundson accepted this revision.Oct 30 2017, 11:44 AM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.

meh, I'd rather we didn't have to link the rather heavy Plasma from KDED.

I'm not going to make you change it, but in future hopefully we can just use the geo code directly.

This revision is now accepted and ready to land.Oct 30 2017, 11:44 AM
evpokp added a subscriber: evpokp.Nov 20 2017, 6:27 PM

Ship it in master for 5.12?

romangg updated this revision to Diff 23700.EditedDec 9 2017, 9:24 PM
  • Simplifiy sun timing calculation (match KWin's calculation),
  • merge current master.
This revision was automatically updated to reflect the committed changes.