Merge pull request #3278 from fufesou/refact/register_breakdown_handler
macos do not alert
This commit is contained in:
commit
7ba3dce006
@ -6,14 +6,15 @@ use hbb_common::platform::macos;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
linux::system_message("test title", "test message", true).ok();
|
let res = linux::system_message("test title", "test message", true);
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
macos::alert(
|
let res = macos::alert(
|
||||||
"RustDesk".to_owned(),
|
"System Preferences".to_owned(),
|
||||||
"warning".to_owned(),
|
"warning".to_owned(),
|
||||||
"test title".to_owned(),
|
"test title".to_owned(),
|
||||||
"test message".to_owned(),
|
"test message".to_owned(),
|
||||||
["Ok".to_owned()].to_vec(),
|
["Ok".to_owned()].to_vec(),
|
||||||
)
|
);
|
||||||
.ok();
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
|
println!("result {:?}", &res);
|
||||||
}
|
}
|
||||||
|
@ -40,15 +40,25 @@ extern "C" fn breakdown_signal_handler(sig: i32) {
|
|||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
.ok();
|
.ok();
|
||||||
#[cfg(target_os = "macos")]
|
// Ignore alert info for now.
|
||||||
macos::alert(
|
// #[cfg(target_os = "macos")]
|
||||||
"RustDesk".to_owned(),
|
// {
|
||||||
"critical".to_owned(),
|
// use std::sync::mpsc::channel;
|
||||||
"Crashed".to_owned(),
|
// use std::time::Duration;
|
||||||
format!("Got signal {} and exit.{}", sig, info),
|
// let (tx, rx) = channel();
|
||||||
["Ok".to_owned()].to_vec(),
|
// std::thread::spawn(move || {
|
||||||
)
|
// macos::alert(
|
||||||
.ok();
|
// "System Preferences".to_owned(),
|
||||||
|
// "critical".to_owned(),
|
||||||
|
// "RustDesk Crashed".to_owned(),
|
||||||
|
// format!("Got signal {} and exit.{}", sig, info),
|
||||||
|
// ["Ok".to_owned()].to_vec(),
|
||||||
|
// )
|
||||||
|
// .ok();
|
||||||
|
// let _ = tx.send(());
|
||||||
|
// });
|
||||||
|
// let _ = rx.recv_timeout(Duration::from_millis(1_000));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user