(Remember to "Reply All" to mailing list threads.)
On 6/2/23 19:49, neo@neoney.dev wrote:
> I’ve tested it and it looks to be perfectly fine, except for 1 minor
> issue - about 90% of time when consecutively sending the signal to it,
> it will exit with a 0 code, with the message:
> `zwlr_gamma_control_v1@6: error 1: The gamma ramps don't have the
> correct size`
Assuming you sent SIGUSR1 to wlsunset *very* fast, then maybe you are
hitting a race in the gamma control protocol.
wlsunset reuses the same mapped file for each output's gamma ramps on
every update. wlroots calls read(3) to read the content of this file,
advancing the file offset and in turn requiring wlsunset to reset the
offset with lseek(3) before the next gamma ramp submission. If gamma
updates are sent faster than wlroots consumes them, the offset reset
will not happen after each read, and wlroots will see a read fail with
EOF and complain.
Either wlroots needs to use a position-independent way to read the file
descriptor, or the protocol needs to be expanded with a "done" event to
synchronize and throttle wlsunset.
... or, you know, just don't intentionally force wlsunset to update at
hyperspeed. :)