This commit is contained in:
rustdesk 2024-05-01 13:05:50 +08:00
parent 08b7e036b4
commit 7ce5f8e8b6

View File

@ -780,7 +780,7 @@ pub fn check_super_user_permission() -> ResultType<bool> {
); );
let arg; let arg;
if Path::new(&file).is_file() { if Path::new(&file).is_file() {
arg = &file; arg = file.as_str();
} else { } else {
arg = "echo"; arg = "echo";
} }
@ -1027,8 +1027,13 @@ mod desktop {
fn get_display_xauth_xwayland(&mut self) { fn get_display_xauth_xwayland(&mut self) {
let tray = format!("{} +--tray", crate::get_app_name().to_lowercase()); let tray = format!("{} +--tray", crate::get_app_name().to_lowercase());
for _ in 0..5 { for _ in 0..5 {
let display_proc = let display_proc = vec![
vec![XWAYLAND, IBUS_DAEMON, GNOME_GOA_DAEMON, PLASMA_KDED, &tray]; XWAYLAND,
IBUS_DAEMON,
GNOME_GOA_DAEMON,
PLASMA_KDED,
tray.as_str(),
];
for proc in display_proc { for proc in display_proc {
self.display = get_env("DISPLAY", &self.uid, proc); self.display = get_env("DISPLAY", &self.uid, proc);
self.xauth = get_env("XAUTHORITY", &self.uid, proc); self.xauth = get_env("XAUTHORITY", &self.uid, proc);
@ -1134,7 +1139,7 @@ mod desktop {
PLASMA_KDED, PLASMA_KDED,
XFCE4_PANEL, XFCE4_PANEL,
SDDM_GREETER, SDDM_GREETER,
&tray, tray.as_str(),
]; ];
for proc in display_proc { for proc in display_proc {
self.xauth = get_env("XAUTHORITY", &self.uid, proc); self.xauth = get_env("XAUTHORITY", &self.uid, proc);