backend: Support wl-dmabuf v6
This commit is contained in:
parent
81cd5fdbaa
commit
091583ac84
14 changed files with 298 additions and 210 deletions
28
src/utils/global.rs
Normal file
28
src/utils/global.rs
Normal 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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue