diff --git a/src/client.rs b/src/client.rs index a48669899..40b3542b3 100644 --- a/src/client.rs +++ b/src/client.rs @@ -91,6 +91,8 @@ pub const LOGIN_MSG_PASSWORD_WRONG: &str = "Wrong Password"; pub const LOGIN_MSG_NO_PASSWORD_ACCESS: &str = "No Password Access"; pub const LOGIN_MSG_OFFLINE: &str = "Offline"; #[cfg(target_os = "linux")] +pub const LOGIN_SCREEN_WAYLAND: &str = "Wayland login screen"; +#[cfg(target_os = "linux")] pub const SCRAP_UBUNTU_HIGHER_REQUIRED: &str = "Wayland requires Ubuntu 21.04 or higher version."; #[cfg(target_os = "linux")] pub const SCRAP_OTHER_VERSION_OR_X11_REQUIRED: &str = @@ -2100,7 +2102,13 @@ struct LoginErrorMsgBox { lazy_static::lazy_static! { static ref LOGIN_ERROR_MAP: Arc> = { use hbb_common::config::LINK_HEADLESS_LINUX_SUPPORT; - let map = HashMap::from([(LOGIN_MSG_DESKTOP_SESSION_NOT_READY, LoginErrorMsgBox{ + let map = HashMap::from([(LOGIN_SCREEN_WAYLAND, LoginErrorMsgBox{ + msgtype: "error", + title: "login_wayland_title_tip", + text: "login_wayland_text_tip", + link: "https://rustdesk.com/docs/en/manual/linux/#login-screen", + try_again: true, + }), (LOGIN_MSG_DESKTOP_SESSION_NOT_READY, LoginErrorMsgBox{ msgtype: "session-login", title: "", text: "", diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 51a731c35..b172ec34b 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index b4a76c62e..004a9e1fc 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "管理的设备数已达到最大值"), ("Sync with recent sessions", "同步最近会话"), ("Sort tags", "对标签进行排序"), + ("login_wayland_title_tip", "无法连接"), + ("login_wayland_text_tip", "不支持 Wayland 登录界面。"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 29898eaf7..cd6e23142 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 0a4adaf36..6400e6f1c 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index c42ac5719..ff01fa645 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Sie haben die maximale Anzahl der verwalteten Geräte erreicht."), ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index eb91e9a83..d49df927a 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/en.rs b/src/lang/en.rs index 001d9133d..6563f5ada 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -73,5 +73,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("clipboard_wait_response_timeout_tip", "Timed out waiting for copy response."), ("logout_tip", "Are you sure you want to log out?"), ("exceed_max_devices", "You have reached the maximum number of managed devices."), + ("login_wayland_title_tip", "Failed to connect"), + ("login_wayland_text_tip", "Login screen of Wayland is not supported."), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index a576538ef..23965e679 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index c39bcb7f5..cf764c542 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Has alcanzado el máximo número de dispositivos administrados."), ("Sync with recent sessions", "Sincronizar con sesiones recientes"), ("Sort tags", "Ordenar etiquetas"), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 112edf32a..9f4ece250 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 57c548e08..2fae8c90d 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 638ed3adf..69cba6c72 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index ac9df01b3..e6b1e268f 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index c89e6cf72..d7fea8cec 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Hai raggiunto il numero massimo di dispositivi gestibili."), ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 67234039d..05cb41089 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index c0b71c205..f0e1b4d4b 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 829c59c73..2732835e3 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 69936b2b4..ea2c80e8e 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 92bd7fd1f..91c90559a 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index af6d11659..a6196206d 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 52675daf7..91e1020bd 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 195b79804..ac374a5ec 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 378d7c035..00494e359 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 6b48ef20b..7b29c106f 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Достигнуто максимальне количество управляемых устройств."), ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index f24f55bef..2dc9e572c 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index ff5c254e0..f74220b92 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 797328139..4ce234d23 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 3bb40f4ce..233eff041 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index ac898e38f..034643a13 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 5c710624f..42784f016 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 2b2d0f4b2..64b422ce6 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index d7bd99f25..26041d881 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index bef733f00..75f0c7a87 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 3b115a5f3..44df50c47 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 59490da1d..2441193bf 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -524,5 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), + ("login_wayland_title_tip", ""), + ("login_wayland_text_tip", ""), ].iter().cloned().collect(); } diff --git a/src/server/connection.rs b/src/server/connection.rs index efa0f88e1..30a87cd80 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1007,14 +1007,22 @@ impl Connection { } #[cfg(target_os = "linux")] if !self.file_transfer.is_some() && !self.port_forward_socket.is_some() { - let dtype = crate::platform::linux::get_display_server(); - if dtype != crate::platform::linux::DISPLAY_SERVER_X11 - && dtype != crate::platform::linux::DISPLAY_SERVER_WAYLAND - { - res.set_error(format!( - "Unsupported display server type \"{}\", x11 or wayland expected", - dtype - )); + 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!( + "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); self.send(msg_out).await; @@ -2387,7 +2395,11 @@ async fn start_ipc( args.push("--hide"); }; - #[cfg(any(feature = "flatpak", feature = "appimage", not(all(target_os = "linux", feature = "linux_headless"))))] + #[cfg(any( + feature = "flatpak", + feature = "appimage", + not(all(target_os = "linux", feature = "linux_headless")) + ))] let user = None; #[cfg(all(target_os = "linux", feature = "linux_headless"))] #[cfg(not(any(feature = "flatpak", feature = "appimage")))]