From 3f7609a5d306eed913f4aa42d4c7dabbe03b86ee Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Wed, 19 Jun 2024 22:12:17 +0300 Subject: [PATCH] output: ignore configures before initial commit --- src/dulcepan.h | 1 + src/output.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/dulcepan.h b/src/dulcepan.h index 9ee63e9..78ca80e 100644 --- a/src/dulcepan.h +++ b/src/dulcepan.h @@ -49,6 +49,7 @@ struct dp_output { bool needs_redraw; struct zwlr_screencopy_frame_v1 *frame; + bool has_frame; // XXX: this is completely untested bool y_invert; diff --git a/src/output.c b/src/output.c index 6a4121a..f9fb3b0 100644 --- a/src/output.c +++ b/src/output.c @@ -20,6 +20,11 @@ static void layer_surface_handle_configure(void *data, struct zwlr_layer_surface uint32_t serial, uint32_t width, uint32_t height) { struct dp_output *output = data; + if (!output->has_frame) { + // Ignore configures that came too early + return; + } + // Thanks layer-shell int i_width = (int)width, i_height = (int)height; @@ -91,6 +96,8 @@ static void frame_handle_ready(void *data, struct zwlr_screencopy_frame_v1 *fram zwlr_screencopy_frame_v1_destroy(output->frame); output->frame = NULL; + output->has_frame = true; + wl_surface_commit(output->main_surface); }