Merge pull request #123 from tomty89/manager_session

Fixes related to systemd manager class session
This commit is contained in:
RustDesk 2025-04-19 09:47:31 +08:00 committed by GitHub
commit 2f8cf74865
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,7 +104,7 @@ pub fn get_display_server_of_session(session: &str) -> String {
} else { } else {
"".to_owned() "".to_owned()
}; };
if display_server.is_empty() || display_server == "tty" { if display_server.is_empty() || display_server == "tty" || display_server == "unspecified" {
if let Ok(sestype) = std::env::var("XDG_SESSION_TYPE") { if let Ok(sestype) = std::env::var("XDG_SESSION_TYPE") {
if !sestype.is_empty() { if !sestype.is_empty() {
return sestype.to_lowercase(); return sestype.to_lowercase();
@ -175,7 +175,7 @@ fn _get_values_of_seat0(indices: &[usize], ignore_gdm_wayland: bool) -> Vec<Stri
continue; continue;
} }
} }
if d == "tty" { if d == "tty" || d == "unspecified" {
continue; continue;
} }
return line_values(indices, line); return line_values(indices, line);