diff --git a/anvil/src/shell.rs b/anvil/src/shell.rs index 9737173..b4057a4 100644 --- a/anvil/src/shell.rs +++ b/anvil/src/shell.rs @@ -270,6 +270,7 @@ pub struct SurfaceData { pub buffer: Option, pub texture: Option, pub dimensions: Option<(i32, i32)>, + pub geometry: Option, pub input_region: Option, } @@ -315,10 +316,15 @@ fn surface_commit( token: CompositorToken, buffer_utils: &BufferUtils, ) { + let geometry = token + .with_role_data(surface, |role: &mut XdgSurfaceRole| role.window_geometry) + .unwrap_or(None); + token.with_surface_data(surface, |attributes| { attributes.user_data.insert_if_missing(SurfaceData::default); let data = attributes.user_data.get_mut::().unwrap(); + data.geometry = geometry; data.input_region = attributes.input_region.clone(); // we retrieve the contents of the associated buffer and copy it