Merge pull request #191 from rust-windowing/wayland-buffer-age-fix

wayland: Fix buffer age
This commit is contained in:
Ian Douglas Scott 2024-01-09 17:41:54 -08:00 committed by GitHub
commit 2b1bb980d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,14 +186,14 @@ impl<D: HasDisplayHandle + ?Sized, W: HasWindowHandle> WaylandImpl<D, W> {
.dispatch_pending(&mut State); .dispatch_pending(&mut State);
if let Some((front, back)) = &mut self.buffers { if let Some((front, back)) = &mut self.buffers {
// Swap front and back buffer
std::mem::swap(front, back);
front.age = 1; front.age = 1;
if back.age != 0 { if back.age != 0 {
back.age += 1; back.age += 1;
} }
// Swap front and back buffer
std::mem::swap(front, back);
front.attach(self.surface.as_ref().unwrap()); front.attach(self.surface.as_ref().unwrap());
// Like Mesa's EGL/WSI implementation, we damage the whole buffer with `i32::MAX` if // Like Mesa's EGL/WSI implementation, we damage the whole buffer with `i32::MAX` if