mirror of
https://github.com/rustdesk/hbb_common.git
synced 2025-07-04 00:45:32 +00:00
Ignore the session type when started as a user unit
If a user for reasons start the program as user unit (instead of as a system unit or in a session), /proc/self/sessionid may result in the inferred session type being "unspecified" and prevent XDG_SESSION_TYPE from being leveraged (and its "x11" fallback).
This commit is contained in:
parent
514ef6ac08
commit
a27b28504d
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user