wlroots
wlroots copied to clipboard
Make wlr_output_enable idempotent
Enabling or disabling an output should be idempotent. Previously, this was not the case, causing bugs.
10:05:29 <emersion> output->pending.enabled only has a meaningful value if WLR_OUTPUT_STATE_ENABLED is set
10:05:36 <emersion> same for the rest of the output state
10:07:00 <emersion> that's the status quo -- i'm not against changing it, but there are gotchas
10:07:53 <emersion> e.g. if we keep the previous state in pending, there has to be an exception for the wlr_buffer field and the gamma tables -- we don't want to keep these locked/allocated after we're done with the commit
10:05:29 <emersion> output->pending.enabled only has a meaningful value if WLR_OUTPUT_STATE_ENABLED is set 10:05:36 <emersion> same for the rest of the output state 10:07:00 <emersion> that's the status quo -- i'm not against changing it, but there are gotchas 10:07:53 <emersion> e.g. if we keep the previous state in pending, there has to be an exception for the wlr_buffer field and the gamma tables -- we don't want to keep these locked/allocated after we're done with the commit
The only time this change will have any effect is if wlr_output_enable is called twice on the same output, with different values of the parameter, before the output commits. Needless to say, this will basically never happen for typical rootful compositors. For rootless compositors such as the one I am working on, however, this happens a LOT. The result is that the output is left with the wrong value of output->pending.enabled, which causes problems later.
I don't understand which kind of issues you're running into. If WLR_OUTPUT_STATE_ENABLED is unset in the flags, you shouldn't even look at pending.enabled.
I don't understand which kind of issues you're running into. If
WLR_OUTPUT_STATE_ENABLEDis unset in the flags, you shouldn't even look atpending.enabled.
I will do some testing locally.
Without this commit my compositor trips over this assertion.
wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to:
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3306