diff --git a/src/wayland/core/registry.rs b/src/wayland/core/registry.rs index 5c0125b..173c8e4 100644 --- a/src/wayland/core/registry.rs +++ b/src/wayland/core/registry.rs @@ -77,14 +77,14 @@ impl Registry { ) .await?; - // self.global( - // client, - // sender_id, - // RegistryGlobals::DMABUF, - // crate::wayland::dmabuf::Dmabuf::INTERFACE.to_string(), - // Dmabuf::VERSION, - // ) - // .await?; + self.global( + client, + sender_id, + RegistryGlobals::DMABUF, + crate::wayland::dmabuf::Dmabuf::INTERFACE.to_string(), + Dmabuf::VERSION, + ) + .await?; Ok(()) } diff --git a/src/wayland/dmabuf/buffer_backing.rs b/src/wayland/dmabuf/buffer_backing.rs index 9944f44..eb7ea1a 100644 --- a/src/wayland/dmabuf/buffer_backing.rs +++ b/src/wayland/dmabuf/buffer_backing.rs @@ -1,5 +1,5 @@ use super::buffer_params::BufferParams; -use crate::wayland::{MessageSink, RENDER_DEVICE}; +use crate::wayland::RENDER_DEVICE; use bevy::{ asset::{Assets, Handle}, image::Image, @@ -17,19 +17,17 @@ use waynest::server::protocol::stable::linux_dmabuf_v1::zwp_linux_buffer_params_ /// Parameters for a shared memory buffer pub struct DmabufBacking { - message_sink: Option, params: Arc, size: Vector2, format: DrmFourcc, _flags: Flags, tex: OnceLock>, - // pending_imported_dmatex: Mutex>, + pending_imported_dmatex: Mutex>, } impl std::fmt::Debug for DmabufBacking { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("DmabufBacking") - .field("message_sink", &self.message_sink) .field("params", &self.params) .field("size", &self.size) .field("format", &self.format) @@ -43,7 +41,6 @@ impl DmabufBacking { #[tracing::instrument(level = "debug", skip_all)] pub fn new( params: Arc, - message_sink: Option, size: Vector2, format: DrmFourcc, flags: Flags, @@ -68,12 +65,11 @@ impl DmabufBacking { Ok(Self { params, - message_sink, size, format, _flags: flags, tex: OnceLock::new(), - // pending_imported_dmatex: Mutex::new(Some(imported_tex)), + pending_imported_dmatex: Mutex::new(Some(imported_tex)), }) } @@ -84,14 +80,13 @@ impl DmabufBacking { images: &mut Assets, ) -> Option> { info!("updating dmabuf tex"); - // self.pending_imported_dmatex - // .lock() - // .take() - // .map(|tex| dmatexes.insert_imported_dmatex(images, tex)) - // .inspect(|handle| { - // _ = self.tex.set(handle.clone()); - // }) - None + self.pending_imported_dmatex + .lock() + .take() + .map(|tex| dmatexes.insert_imported_dmatex(images, tex)) + .inspect(|handle| { + _ = self.tex.set(handle.clone()); + }) } pub fn is_transparent(&self) -> bool { diff --git a/src/wayland/dmabuf/buffer_params.rs b/src/wayland/dmabuf/buffer_params.rs index f775372..d035ac0 100644 --- a/src/wayland/dmabuf/buffer_params.rs +++ b/src/wayland/dmabuf/buffer_params.rs @@ -106,7 +106,6 @@ impl ZwpLinuxBufferParamsV1 for BufferParams { let size = [width as u32, height as u32].into(); let buffer = DmabufBacking::new( client.get::(self.id).unwrap(), - Some(client.display().message_sink.clone()), size, DrmFourcc::try_from(format).unwrap(), flags, @@ -141,7 +140,6 @@ impl ZwpLinuxBufferParamsV1 for BufferParams { // Create the buffer with DMA-BUF backing using self as the backing _ = DmabufBacking::new( client.get::(self.id).unwrap(), - None, [width as u32, height as u32].into(), DrmFourcc::try_from(format).unwrap(), flags,