From 27478946ea741389b30d9201a07e48bcaa906fe5 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 19 Jun 2024 21:17:26 +0800 Subject: [PATCH] open new window not always work, so give it a little time before exit --- src/ipc.rs | 2 ++ src/platform/macos.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/ipc.rs b/src/ipc.rs index cae959a19..b33264d3e 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -379,6 +379,8 @@ async fn handle(data: Data, stream: &mut Connection) { .spawn() .ok(); } + // leave above open a little time + hbb_common::sleep(0.3).await; } std::process::exit(-1); // to make sure --server luauchagent process can restart because SuccessfulExit used } diff --git a/src/platform/macos.rs b/src/platform/macos.rs index 58678b007..65e7cf97d 100644 --- a/src/platform/macos.rs +++ b/src/platform/macos.rs @@ -263,6 +263,8 @@ pub fn uninstall_service(show_new_window: bool, sync: bool) -> bool { .arg(&format!("/Applications/{}.app", crate::get_app_name())) .spawn() .ok(); + // leave open a little time + std::thread::sleep(std::time::Duration::from_millis(300)); } quit_gui(); }