mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
use autostart for --tray in linux because pkexec not work well when start it with --server
This commit is contained in:
@@ -1071,17 +1071,17 @@ pub fn check_process(arg: &str, same_uid: bool) -> bool {
|
||||
.map(|x| x.user_id())
|
||||
.unwrap_or_default();
|
||||
for (_, p) in sys.processes().iter() {
|
||||
if p.pid().to_string() == std::process::id().to_string() {
|
||||
continue;
|
||||
}
|
||||
if same_uid && p.user_id() != my_uid {
|
||||
continue;
|
||||
}
|
||||
if p.cmd().is_empty() || p.cmd()[0] != app {
|
||||
if p.exe().to_string_lossy() != app {
|
||||
continue;
|
||||
}
|
||||
if arg.is_empty() {
|
||||
if p.cmd().len() == 1 {
|
||||
return true;
|
||||
}
|
||||
} else if p.cmd().len() > 1 && p.cmd()[1] == arg {
|
||||
let parg = if p.cmd().len() <= 1 { "" } else { &p.cmd()[1] };
|
||||
if arg == parg {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user