output-layer: require all layers in wlr_output_state.layers

- Simplifies the backends
- Avoids having two ways to do the same thing: previously one could
  disable a layer by either omitting it from wlr_output_state.layers,
  or by passing a NULL buffer
- We can change our mind in the future: we can allow users to omit
  some layers and define a meaning without breaking the API.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4017#note_1783997
This commit is contained in:
Simon Ser 2023-02-21 18:34:11 +01:00 committed by Alexander Orzechowski
parent 87969c1c7c
commit 1b6fac4aa6
3 changed files with 7 additions and 25 deletions

View file

@ -673,6 +673,11 @@ static bool output_basic_test(struct wlr_output *output,
}
if (state->committed & WLR_OUTPUT_STATE_LAYERS) {
if (state->layers_len != (size_t)wl_list_length(&output->layers)) {
wlr_log(WLR_DEBUG, "All output layers must be specified in wlr_output_state.layers");
return false;
}
for (size_t i = 0; i < state->layers_len; i++) {
state->layers[i].accepted = false;
}