1
0
Fork 0
forked from wry/wry

surface: attach sync sub-surface commits to parent commits

This commit is contained in:
Julian Orth 2024-03-20 19:41:43 +01:00
parent 0c48247740
commit 300deecc7d
8 changed files with 268 additions and 52 deletions

View file

@ -76,6 +76,25 @@ pub struct PendingLayerSurfaceData {
any: bool,
}
impl PendingLayerSurfaceData {
pub fn merge(&mut self, next: &mut Self) {
macro_rules! opt {
($name:ident) => {
if let Some(n) = next.$name.take() {
self.$name = Some(n);
}
};
}
opt!(size);
opt!(anchor);
opt!(exclusive_zone);
opt!(margin);
opt!(keyboard_interactivity);
opt!(layer);
self.any |= mem::take(&mut next.any);
}
}
impl ZwlrLayerSurfaceV1 {
pub fn new(
id: ZwlrLayerSurfaceV1Id,