WIP org.freedesktop.ScreenSaver

This commit is contained in:
Ian Douglas Scott 2024-10-28 10:22:22 -07:00
parent 163356f012
commit a0ddfa80b7
2 changed files with 59 additions and 1 deletions

View file

@ -32,6 +32,8 @@ use wayland_protocols_wlr::{
output_power_management::v1::client::{zwlr_output_power_manager_v1, zwlr_output_power_v1},
};
mod freedesktop_screensaver;
const FADE_TIME: Duration = Duration::from_millis(2000);
#[derive(Debug)]
@ -238,7 +240,7 @@ fn main() {
let seat = globals
.bind::<wl_seat::WlSeat, _, _>(&qh, 1..=1, ())
.unwrap();
seat.get_pointer(&qh, ()); // XXX
seat.get_pointer(&qh, ());
let compositor = globals
.bind::<wl_compositor::WlCompositor, _, _>(&qh, 1..=1, ())
@ -330,6 +332,16 @@ fn main() {
}
})
.unwrap();
scheduler
.schedule(async {
if let Ok(connection) = zbus::Connection::session().await {
if let Err(err) = freedesktop_screensaver::serve(&connection).await {
log::error!("failed to serve FreeDesktop screensaver interface: {}", err);
}
std::future::pending::<()>().await;
}
})
.unwrap();
event_loop
.handle()
.insert_source(executor, |_, _, _| {})