mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-06 01:41:29 +03:00
fix: linux, get_env, break loop (#12174)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -1047,7 +1047,7 @@ 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 1..=10 {
|
||||||
let display_proc = vec![
|
let display_proc = vec![
|
||||||
XWAYLAND,
|
XWAYLAND,
|
||||||
IBUS_DAEMON,
|
IBUS_DAEMON,
|
||||||
@@ -1060,7 +1060,7 @@ mod desktop {
|
|||||||
self.xauth = get_env("XAUTHORITY", &self.uid, proc);
|
self.xauth = get_env("XAUTHORITY", &self.uid, proc);
|
||||||
self.wl_display = get_env("WAYLAND_DISPLAY", &self.uid, proc);
|
self.wl_display = get_env("WAYLAND_DISPLAY", &self.uid, proc);
|
||||||
if !self.display.is_empty() && !self.xauth.is_empty() {
|
if !self.display.is_empty() && !self.xauth.is_empty() {
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sleep_millis(300);
|
sleep_millis(300);
|
||||||
@@ -1068,7 +1068,7 @@ mod desktop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_display_x11(&mut self) {
|
fn get_display_x11(&mut self) {
|
||||||
for _ in 0..10 {
|
for _ in 1..=10 {
|
||||||
let display_proc = vec![
|
let display_proc = vec![
|
||||||
XWAYLAND,
|
XWAYLAND,
|
||||||
IBUS_DAEMON,
|
IBUS_DAEMON,
|
||||||
@@ -1083,6 +1083,9 @@ mod desktop {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !self.display.is_empty() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
sleep_millis(300);
|
sleep_millis(300);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1152,7 +1155,7 @@ mod desktop {
|
|||||||
fn get_xauth_x11(&mut self) {
|
fn get_xauth_x11(&mut self) {
|
||||||
// try by direct access to window manager process by name
|
// try by direct access to window manager process by name
|
||||||
let tray = format!("{} +--tray", crate::get_app_name().to_lowercase());
|
let tray = format!("{} +--tray", crate::get_app_name().to_lowercase());
|
||||||
for _ in 0..10 {
|
for _ in 1..=10 {
|
||||||
let display_proc = vec![
|
let display_proc = vec![
|
||||||
XWAYLAND,
|
XWAYLAND,
|
||||||
IBUS_DAEMON,
|
IBUS_DAEMON,
|
||||||
@@ -1168,6 +1171,9 @@ mod desktop {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !self.xauth.is_empty() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
sleep_millis(300);
|
sleep_millis(300);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user