aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-11-17 00:56:27 +0100
committerDrew DeVault <sir@cmpwn.com>2019-11-21 11:03:43 -0500
commit3084cee7bc6209b5431e00fee86eec6355817bad (patch)
tree0549b9ccf694f73442a3c14952ae36277be55fae
parent2d9661f189c5e89dcd1b4b5a289dc9229cf8ab5a (diff)
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.
-rw-r--r--types/wlr_output.c2
1 files changed, 1 insertions, 1 deletions
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;