aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/wayland/output.c25
-rw-r--r--include/wlr/types/wlr_output_layer.h2
-rw-r--r--types/output/output.c5
3 files changed, 7 insertions, 25 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 7d2fdb34..3f16388d 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -399,31 +399,6 @@ static bool commit_layers(struct wlr_wl_output *output,
}
}
- // Unmap any layer we haven't seen
- struct wlr_output_layer *wlr_layer;
- wl_list_for_each(wlr_layer, &output->wlr_output.layers, link) {
- bool found = false;
- for (size_t i = 0; i < layers_len; i++) {
- if (layers[i].layer == wlr_layer) {
- found = true;
- break;
- }
- }
- if (found) {
- continue;
- }
-
- struct wlr_wl_output_layer *layer =
- get_or_create_output_layer(output, wlr_layer);
- if (layer == NULL) {
- continue;
- }
-
- // TODO: only do this once
- wl_surface_attach(layer->surface, NULL, 0, 0);
- wl_surface_commit(layer->surface);
- }
-
return true;
}
diff --git a/include/wlr/types/wlr_output_layer.h b/include/wlr/types/wlr_output_layer.h
index bd10fd12..1ba69c8f 100644
--- a/include/wlr/types/wlr_output_layer.h
+++ b/include/wlr/types/wlr_output_layer.h
@@ -36,6 +36,8 @@
* Callers are responsible for disabling output layers when they need the full
* output contents to be composited onto a single buffer, e.g. during screen
* capture.
+ *
+ * Callers must always include the state for all layers on output test/commit.
*/
struct wlr_output_layer {
struct wl_list link; // wlr_output.layers
diff --git a/types/output/output.c b/types/output/output.c
index 75defcc2..6d331b93 100644
--- a/types/output/output.c
+++ b/types/output/output.c
@@ -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;
}