From 3d5196972600bff8ea8e91b5e3c8c54d1661ae83 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Tue, 6 Feb 2024 10:56:15 +0100 Subject: [PATCH] wayland: implement wl_shm v2 --- src/ifs/wl_shm.rs | 11 +++++++++-- wire/wl_shm.txt | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ifs/wl_shm.rs b/src/ifs/wl_shm.rs index 4841712d..90ac412e 100644 --- a/src/ifs/wl_shm.rs +++ b/src/ifs/wl_shm.rs @@ -71,6 +71,12 @@ impl WlShm { self.client.add_client_obj(&pool)?; Ok(()) } + + fn release(&self, parser: MsgParser<'_, '_>) -> Result<(), WlShmError> { + let _req: Release = self.client.parse(self, parser)?; + self.client.remove_obj(self)?; + Ok(()) + } } global_base!(WlShmGlobal, WlShm, WlShmError); @@ -81,7 +87,7 @@ impl Global for WlShmGlobal { } fn version(&self) -> u32 { - 1 + 2 } } @@ -91,11 +97,12 @@ object_base! { WlShm; CREATE_POOL => create_pool, + RELEASE => release, } impl Object for WlShm { fn num_requests(&self) -> u32 { - CREATE_POOL + 1 + RELEASE + 1 } } diff --git a/wire/wl_shm.txt b/wire/wl_shm.txt index 28ff19c4..cc157ad3 100644 --- a/wire/wl_shm.txt +++ b/wire/wl_shm.txt @@ -6,6 +6,9 @@ msg create_pool = 0 { size: i32, } +msg release = 1 { +} + # events msg format = 0 {