From f016eca97cf046c5273c5112201588d4fdca9818 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 3 Dec 2021 11:06:49 +0100 Subject: [PATCH] output: add wlr_output_event_commit.buffer This allows output commit listeners to access the newly committed buffer. Currently wlr_output.front_buffer is used but it'll get removed in the next commit. --- include/wlr/types/wlr_output.h | 1 + types/output/output.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 9e18a216..689b8158 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -211,6 +211,7 @@ struct wlr_output_event_commit { struct wlr_output *output; uint32_t committed; // bitmask of enum wlr_output_state_field struct timespec *when; + struct wlr_buffer *buffer; // NULL if no buffer is committed }; enum wlr_output_present_flag { diff --git a/types/output/output.c b/types/output/output.c index e82ec1dc..8655ef98 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -743,6 +743,7 @@ bool wlr_output_commit(struct wlr_output *output) { .output = output, .committed = committed, .when = &now, + .buffer = back_buffer, }; wlr_signal_emit_safe(&output->events.commit, &event);