use autostart for --tray in linux because pkexec not work well when start it with --server

This commit is contained in:
rustdesk
2023-06-10 01:55:32 +08:00
parent b14ae250b7
commit 87b32ad8c4
5 changed files with 37 additions and 8 deletions

View File

@@ -41,6 +41,14 @@ pub fn core_main() -> Option<Vec<String>> {
}
i += 1;
}
#[cfg(any(target_os = "linux", target_os = "windows"))]
if args.is_empty() {
#[cfg(target_os = "linux")]
hbb_common::allow_err!(crate::platform::check_autostart_config());
if crate::check_process("--server", false) && !crate::check_process("--tray", true) {
hbb_common::allow_err!(crate::run_me(vec!["--tray"]));
}
}
#[cfg(not(debug_assertions))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
register_breakdown_handler(breakdown_callback);