From 88ac16c99a4a86f61a38ac4584bf13a9358f6236 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 1 Mar 2024 12:56:55 +0400 Subject: tty: Bump sequence on successful queue_frame() Before this commit: - niri queues frame - successful VBlank happens, sequence is bumped, frame callbacks are sent - niri receives commit, redraws, queues next frame, tries to send frame callbacks, but there wasn't a new VBlank yet, so the sequence is old, and frame callbacks aren't sent - frame callbacks are sent only next VBlank --- src/backend/tty.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 117cb0da..63e81322 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -1147,6 +1147,13 @@ impl Tty { } }; + // We queued this frame successfully, so now we'll be sending frame + // callbacks for the next sequence. + if let Some(sequence) = output_state.current_estimated_sequence.as_mut() + { + *sequence = sequence.wrapping_add(1); + } + return RenderResult::Submitted; } Err(err) => { -- cgit