feat(wayland): WIP implementation of wp_importer

This commit was merged in pull request #51.
This commit is contained in:
Thomas Colliers
2025-08-16 17:58:19 +02:00
committed by Schmarni
parent 877a32ab09
commit 7a3322efad
3 changed files with 88 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ use crate::wayland::{
dmabuf::Dmabuf,
mesa_drm::MesaDrm,
presentation::Presentation,
viewporter::Viewporter,
util::ClientExt,
xdg::wm_base::{WmBase, XdgWmBase},
};
@@ -20,7 +21,7 @@ use waynest::{
external::drm::wl_drm::WlDrm,
stable::{
linux_dmabuf_v1::zwp_linux_dmabuf_v1::ZwpLinuxDmabufV1,
presentation_time::wp_presentation::WpPresentation,
presentation_time::wp_presentation::WpPresentation, viewporter::wp_viewporter::WpViewporter,
},
},
},
@@ -38,6 +39,7 @@ impl RegistryGlobals {
pub const DMABUF: u32 = 6;
pub const WL_DRM: u32 = 7;
pub const PRESENTATION: u32 = 8;
pub const VIEWPORTER: u32 = 9;
}
#[derive(Debug, Dispatcher, Default)]
@@ -126,6 +128,15 @@ impl Registry {
)
.await?;
self.global(
client,
sender_id,
RegistryGlobals::VIEWPORTER,
Viewporter::INTERFACE.to_string(),
Viewporter::VERSION,
)
.await?;
Ok(())
}
}
@@ -198,6 +209,11 @@ impl WlRegistry for Registry {
client.insert(new_id.object_id, Presentation);
}
RegistryGlobals::VIEWPORTER => {
tracing::info!("Binding wp_viewporter");
client.insert(new_id.object_id, Viewporter::default());
}
id => {
tracing::error!(id, "Wayland: failed to bind to registry global");
return Err(Error::MissingObject(unsafe { ObjectId::from_raw(name) }));