refact, linux headless option, debug

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-07-29 17:16:53 +08:00
parent d761d2f00e
commit 5403166552
2 changed files with 16 additions and 13 deletions

View File

@@ -1007,21 +1007,18 @@ impl Connection {
}
#[cfg(target_os = "linux")]
if !self.file_transfer.is_some() && !self.port_forward_socket.is_some() {
let mut msg = "".to_owned();
if crate::platform::linux::is_login_wayland() {
msg = crate::client::LOGIN_SCREEN_WAYLAND.to_owned();
} else {
let dtype = crate::platform::linux::get_display_server();
if dtype != crate::platform::linux::DISPLAY_SERVER_X11
&& dtype != crate::platform::linux::DISPLAY_SERVER_WAYLAND
{
msg = format!(
let dtype = crate::platform::linux::get_display_server();
if dtype != crate::platform::linux::DISPLAY_SERVER_X11
&& dtype != crate::platform::linux::DISPLAY_SERVER_WAYLAND
{
let msg = if crate::platform::linux::is_login_screen_wayland() {
crate::client::LOGIN_SCREEN_WAYLAND.to_owned()
} else {
format!(
"Unsupported display server type \"{}\", x11 or wayland expected",
dtype
);
}
}
if !msg.is_empty() {
)
};
res.set_error(msg);
let mut msg_out = Message::new();
msg_out.set_login_response(res);