refactor(wayland): many things

This commit is contained in:
Nova
2025-09-06 23:56:29 -07:00
parent a0b014576e
commit 1c8aa93850
5 changed files with 174 additions and 106 deletions

View File

@@ -71,6 +71,13 @@ impl Default for SurfaceState {
}
}
}
impl SurfaceState {
pub fn has_valid_buffer(&self) -> bool {
self.buffer
.as_ref()
.is_some_and(|b| b.buffer.size().x > 0 && b.buffer.size().y > 0)
}
}
// if returning false, don't run this callback again... just remove it
pub type OnCommitCallback = Box<dyn Fn(&Surface, &SurfaceState) -> bool + Send + Sync>;