mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 15:53:00 +08:00
fix linux lock screen
This commit is contained in:
parent
362aa9a8ff
commit
565e81d329
@ -585,19 +585,7 @@ pub fn get_pa_sources() -> Vec<(String, String)> {
|
||||
}
|
||||
|
||||
pub fn lock_screen() {
|
||||
std::thread::spawn(move || {
|
||||
use crate::server::input_service::handle_key;
|
||||
use hbb_common::message_proto::*;
|
||||
let mut evt = KeyEvent {
|
||||
down: true,
|
||||
modifiers: vec![ControlKey::Meta.into()],
|
||||
..Default::default()
|
||||
};
|
||||
evt.set_chr('l' as _);
|
||||
handle_key(&evt);
|
||||
evt.down = false;
|
||||
handle_key(&evt);
|
||||
});
|
||||
std::process::Command::new("xdg-screensaver").arg("lock").spawn().ok();
|
||||
}
|
||||
|
||||
pub fn toggle_blank_screen(_v: bool) {
|
||||
|
Loading…
Reference in New Issue
Block a user