Disentangle frame callback sequence from real DRM sequence

It can currently happen that the estimated VBlank timer fires right
before a real VBlank, which can cause some sequence collisions, which
might cause frame callbacks to never be sent. To prevent this, just
track the frame callback sequence fully separately. There isn't really
any harm in this, and if we accidentally increment it more frequently
than necessary then nothing terrible will happen.
This commit is contained in:
Ivan Molodetskikh
2024-03-02 08:10:05 +04:00
parent 24537ec2ba
commit 93243d7772
3 changed files with 43 additions and 30 deletions
+4
View File
@@ -199,6 +199,10 @@ impl Winit {
RedrawState::WaitingForEstimatedVBlankAndQueued(_) => unreachable!(),
}
output_state.frame_callback_sequence = output_state.frame_callback_sequence.wrapping_add(1);
// FIXME: this should wait until a frame callback from the host compositor, but it redraws
// right away instead.
if output_state.unfinished_animations_remain {
self.backend.window().request_redraw();
}