Update time when resuming from sleep
This commit is contained in:
parent
b38bcd296a
commit
046f805084
1 changed files with 3 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ use logind_zbus::{
|
|||
use std::{any::TypeId, error::Error, os::fd::OwnedFd, sync::Arc, time::Duration};
|
||||
use zbus::Connection;
|
||||
|
||||
use crate::locker::Message;
|
||||
use crate::{common, locker::Message};
|
||||
|
||||
pub async fn power_off() -> zbus::Result<()> {
|
||||
let connection = Connection::system().await?;
|
||||
|
|
@ -99,6 +99,8 @@ pub async fn handler(msg_tx: &mut mpsc::Sender<Message>) -> Result<(), Box<dyn E
|
|||
if inhibit_opt.is_none() {
|
||||
inhibit_opt = Some(inhibit(&manager).await?);
|
||||
}
|
||||
// Immediately update time when resuming from sleep.
|
||||
msg_tx.send(Message::Common(common::Message::Tick)).await?;
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue