Add comments

This commit is contained in:
Ian Douglas Scott 2024-10-28 18:40:07 -07:00
parent 90151799c5
commit e8feb4342c
3 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,5 @@
// Layer shell surface that fades to black, before setting DPMS off.
use keyframe::{ease, functions::EaseInOut};
use std::time::{Duration, Instant};
use wayland_client::{

View file

@ -88,6 +88,7 @@ pub async fn serve(conn: &zbus::Connection, event_sender: EventSender) -> zbus::
)
.await?;
// If a client disconnects from DBus, remove any inhibitors it has added.
let dbus = zbus::fdo::DBusProxy::new(conn).await?;
let mut name_owner_stream = dbus.receive_name_owner_changed().await?;
while let Some(event) = name_owner_stream.next().await {

View file

@ -147,12 +147,14 @@ impl State {
}
}
// If screen off or suspend idle times have changed, recreate idle notifications.
fn recreate_notification(&mut self) {
if self.screen_off_idle_notification.as_ref().map(|x| x.time) != self.conf.screen_off_time {
self.screen_off_idle_notification = self
.conf
.screen_off_time
.map(|time| IdleNotification::new(&self.inner, time));
// Initially not idle; server sends `resumed` only after `idled`
self.update_screen_off_idle(false);
}
let suspend_time = if self.on_battery {
@ -163,6 +165,7 @@ impl State {
if self.suspend_idle_notification.as_ref().map(|x| x.time) != suspend_time {
self.suspend_idle_notification =
suspend_time.map(|time| IdleNotification::new(&self.inner, time));
// Initially not idle; server sends `resumed` only after `idled`
self.update_suspend_idle(false);
}
}