wayland: Fix buffer age

We need to reset the age of the *new* front buffer to 1, not the old
one.

It turns out they're easy to mix up right when you're about to swap
them.
This commit is contained in:
Ian Douglas Scott 2024-01-09 03:28:08 -08:00
parent ef49741254
commit d26ae5b895

View file

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