macOS, ignore alert for now

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-02-19 21:28:48 +08:00
parent e1254c0b24
commit b4beb78e8f

View File

@ -40,24 +40,25 @@ extern "C" fn breakdown_signal_handler(sig: i32) {
true, true,
) )
.ok(); .ok();
#[cfg(target_os = "macos")] // Ignore alert info for now.
{ // #[cfg(target_os = "macos")]
use std::sync::mpsc::channel; // {
use std::time::Duration; // use std::sync::mpsc::channel;
let (tx, rx) = channel(); // use std::time::Duration;
std::thread::spawn(move || { // let (tx, rx) = channel();
macos::alert( // std::thread::spawn(move || {
"System Preferences".to_owned(), // macos::alert(
"critical".to_owned(), // "System Preferences".to_owned(),
"RustDesk Crashed".to_owned(), // "critical".to_owned(),
format!("Got signal {} and exit.{}", sig, info), // "RustDesk Crashed".to_owned(),
["Ok".to_owned()].to_vec(), // format!("Got signal {} and exit.{}", sig, info),
) // ["Ok".to_owned()].to_vec(),
.ok(); // )
let _ = tx.send(()); // .ok();
}); // let _ = tx.send(());
let _ = rx.recv_timeout(Duration::from_millis(1_000)); // });
} // let _ = rx.recv_timeout(Duration::from_millis(1_000));
// }
} }
exit(0); exit(0);
} }