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() {
|
pub fn lock_screen() {
|
||||||
std::thread::spawn(move || {
|
std::process::Command::new("xdg-screensaver").arg("lock").spawn().ok();
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_blank_screen(_v: bool) {
|
pub fn toggle_blank_screen(_v: bool) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user