aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-03-01 12:56:55 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-03-01 12:56:55 +0400
commit88ac16c99a4a86f61a38ac4584bf13a9358f6236 (patch)
tree28eac08f6e3c750119e65e0a30bad62cb3cb0820 /src/backend
parent0add457cf0b82fd3c2c85c488bd9e6171695fcbf (diff)
downloadniri-88ac16c99a4a86f61a38ac4584bf13a9358f6236.tar.gz
niri-88ac16c99a4a86f61a38ac4584bf13a9358f6236.tar.bz2
niri-88ac16c99a4a86f61a38ac4584bf13a9358f6236.zip
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
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/tty.rs7
1 files changed, 7 insertions, 0 deletions
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) => {