mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-24 05:31:03 +03:00
keep server device awake if have connection
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -701,3 +701,18 @@ pub fn elevate(args: Vec<&str>, prompt: &str) -> ResultType<bool> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct WakeLock(Option<keepawake::AwakeHandle>);
|
||||
|
||||
impl WakeLock {
|
||||
pub fn new(display: bool, idle: bool, sleep: bool) -> Self {
|
||||
WakeLock(
|
||||
keepawake::Builder::new()
|
||||
.display(display)
|
||||
.idle(idle)
|
||||
.sleep(sleep)
|
||||
.create()
|
||||
.ok(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user