presentation: store input timestamp in a per-commit context

This should reduce the risk of mixing up an input timestamp with the
corresponding rendered frame.
This commit is contained in:
Daniel Eklöf 2020-01-21 18:51:04 +01:00
parent 3600099b52
commit d6ea676ef2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 42 additions and 35 deletions

View file

@ -528,12 +528,13 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
term_to_slave(term, buf, count);
}
clock_gettime(
term->wl->presentation_clock_id, &term->render.input_time);
term_reset_view(term);
selection_cancel(term);
maybe_repeat:
clock_gettime(
term->wl->presentation_clock_id, &term->render.input_time);
if (should_repeat)
start_repeater(wayl, key - 8);