From 3084cee7bc6209b5431e00fee86eec6355817bad Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 17 Nov 2019 00:56:27 +0100 Subject: [PATCH] output: fix off-by-one wlr_output_event_present.commit_seq Backends not supporting presentation feedback call wlr_output_send_present with a NULL event in their commit handler. Since the commit hasn't been applied yet, commit_seq still has its old value. We need to increment it. An alternative would be to move commit_seq in wlr_output_state. This would allow to have a pending and a current commit_seq. wlr_output_send_present could take the pending commit_seq when called with a NULL event. --- types/wlr_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_output.c b/types/wlr_output.c index 3e397532..bf29ff9c 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -570,7 +570,7 @@ void wlr_output_send_present(struct wlr_output *output, struct wlr_output_event_present _event = {0}; if (event == NULL) { event = &_event; - event->commit_seq = output->commit_seq; + event->commit_seq = output->commit_seq + 1; } event->output = output;