backend: Support wl-dmabuf v6

This commit is contained in:
Victoria Brekenfeld 2026-01-09 13:47:31 +01:00 • committed by Victoria Brekenfeld
parent 81cd5fdbaa
commit 091583ac84
14 changed files with 298 additions and 210 deletions

28
src/utils/global.rs Normal file
View file

@ -0,0 +1,28 @@
use std::time::Duration;
use calloop::{
LoopHandle,
timer::{TimeoutAction, Timer},
};
use smithay::reexports::wayland_server::DisplayHandle;
use wayland_backend::server::GlobalId;
pub fn remove_global_with_timer<D: 'static>(
dh: &DisplayHandle,
event_loop_handle: &LoopHandle<D>,
id: GlobalId,
) {
dh.disable_global::<D>(id.clone());
let source = Timer::from_duration(Duration::from_secs(5));
let dh = dh.clone();
let res = event_loop_handle.insert_source(source, move |_, _, _state| {
dh.remove_global::<D>(id.clone());
TimeoutAction::Drop
});
if let Err(err) = res {
tracing::error!(
"failed to insert timer source to destroy output global: {}",
err
);
}
}

View file

@ -4,6 +4,7 @@ pub mod env;
mod ids;
pub(crate) use self::ids::id_gen;
pub mod geometry;
pub mod global;
pub mod iced;
pub mod prelude;
pub mod quirks;