Skip to content

[WIP] Workaround for broken Night Light on tiled displays (#39)

I was curious to see if #39 could be fixed without changing any abstractions in gnome-rr. This is a WIP branch that's good enough to fix the issue on my machine, but it definitely shouldn't be merged like this.

The basic idea here is that gcm_session_get_state_output_by_id does not only return the first GnomeRROutput that matches the device ID, but all of them (in a GPtrArray). This list of outputs or output IDs is then carried all the way into gcm_session_device_set_gamma, which iterates over them and changes each output's gamma.

However, it does get a bit awkward in some places. For example, this code assumes that all outputs in a device have same-sized gamma curves. I'm not sure if this could blow up in some situation.

If you think that this approach has any merit, I can try to clean it up a little. Frankly, I think an updated GnomeRR API (so that one GnomeRROutput == one CdDevice) would be much cleaner; I don't mind if this branch goes straight into the trash can :)

Merge request reports