temp commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-03-30 18:16:48 +08:00
parent 34c3615320
commit d82d2471d7
7 changed files with 71 additions and 26 deletions

View File

@@ -815,8 +815,19 @@ pub mod connection_manager {
}
}
#[inline]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn start_cm_no_ui() {
start_listen_ipc(false);
}
#[inline]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn start_listen_ipc_thread() {
start_listen_ipc(true);
}
fn start_listen_ipc(new_thread: bool) {
use crate::ui_cm_interface::{start_ipc, ConnectionManager};
#[cfg(target_os = "linux")]
@@ -825,7 +836,11 @@ pub mod connection_manager {
let cm = ConnectionManager {
ui_handler: FlutterHandler {},
};
std::thread::spawn(move || start_ipc(cm));
if new_thread {
std::thread::spawn(move || start_ipc(cm));
} else {
start_ipc(cm);
}
}
#[cfg(target_os = "android")]