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

@ -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);
}
}