1
0
mirror of https://codeberg.org/vyivel/dulcepan/ synced 2025-12-17 15:45:12 +02:00

output: ignore configures before initial commit

This commit is contained in:
Kirill Primak
2024-06-19 22:12:17 +03:00
parent dfd6a493e0
commit 3f7609a5d3
2 changed files with 8 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ struct dp_output {
bool needs_redraw; bool needs_redraw;
struct zwlr_screencopy_frame_v1 *frame; struct zwlr_screencopy_frame_v1 *frame;
bool has_frame;
// XXX: this is completely untested // XXX: this is completely untested
bool y_invert; bool y_invert;

View File

@@ -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) { uint32_t serial, uint32_t width, uint32_t height) {
struct dp_output *output = data; struct dp_output *output = data;
if (!output->has_frame) {
// Ignore configures that came too early
return;
}
// Thanks layer-shell // Thanks layer-shell
int i_width = (int)width, i_height = (int)height; 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); zwlr_screencopy_frame_v1_destroy(output->frame);
output->frame = NULL; output->frame = NULL;
output->has_frame = true;
wl_surface_commit(output->main_surface); wl_surface_commit(output->main_surface);
} }