output: introduce request_state event
This allows backends to request the compositor to change the state of an output.
Sway PR: https://github.com/swaywm/sway/pull/5979
References: https://github.com/swaywm/wlroots/issues/2300#issuecomment-761819673
wlr_output_state
is re-used here, and part of it is not useful for the purposes of request_state
. For instance, the backend should never need to request a specific buffer to be pushed. I think the backends will mostly stick to mode/enable and perhaps scale/transform when nested (X11/Wayland backend, or DRM backend in a VM). We could just copy over the fields we need, but it's probably not worth it.
Breaking change: Backends no longer change the output mode behind the compositor's back. To retain the previous behavior, compositors can listen to the request_state
event and call wlr_output_commit_state
.
cc @ammen99 @hedgepigdaniel