fix: macos, crash, key input. --server also has UI. (#7878)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
28bf73cd5a
commit
003b9e48e1
@ -1086,21 +1086,25 @@ pub async fn lock_screen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
pub fn handle_key(evt: &KeyEvent) {
|
pub fn handle_key(evt: &KeyEvent) {
|
||||||
|
handle_key_(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
pub fn handle_key(evt: &KeyEvent) {
|
||||||
|
crate::portable_service::client::handle_key(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
if !is_server() {
|
pub fn handle_key(evt: &KeyEvent) {
|
||||||
// having GUI, run main GUI thread, otherwise crash
|
// having GUI, run main GUI thread, otherwise crash
|
||||||
let evt = evt.clone();
|
let evt = evt.clone();
|
||||||
QUEUE.exec_async(move || handle_key_(&evt));
|
QUEUE.exec_async(move || handle_key_(&evt));
|
||||||
key_sleep();
|
key_sleep();
|
||||||
return;
|
|
||||||
}
|
|
||||||
#[cfg(windows)]
|
|
||||||
crate::portable_service::client::handle_key(evt);
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
handle_key_(evt);
|
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
key_sleep();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user