diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 9eae57b9e..e0cb5a676 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -301,15 +301,6 @@ class _DesktopHomePageState extends State<DesktopHomePage> } Widget buildHelpCards() { - if (Platform.isWindows) { - if (!bind.mainIsInstalled()) { - return buildInstallCard( - "", "install_tip", "Install", bind.mainGotoInstall); - } else if (bind.mainIsInstalledLowerVersion()) { - return buildInstallCard("Status", "Your installation is lower version.", - "Click to upgrade", bind.mainUpdateMe); - } - } if (updateUrl.isNotEmpty) { return buildInstallCard( "Status", @@ -322,7 +313,15 @@ class _DesktopHomePageState extends State<DesktopHomePage> if (systemError.isNotEmpty) { return buildInstallCard("", systemError, "", () {}); } - if (Platform.isMacOS) { + if (Platform.isWindows) { + if (!bind.mainIsInstalled()) { + return buildInstallCard( + "", "install_tip", "Install", bind.mainGotoInstall); + } else if (bind.mainIsInstalledLowerVersion()) { + return buildInstallCard("Status", "Your installation is lower version.", + "Click to upgrade", bind.mainUpdateMe); + } + } else if (Platform.isMacOS) { if (!bind.mainIsCanScreenRecording(prompt: false)) { return buildInstallCard("Permissions", "config_screen", "Configure", () async { @@ -342,8 +341,19 @@ class _DesktopHomePageState extends State<DesktopHomePage> bind.mainIsInstalledDaemon(prompt: true); }); } + } else if (Platform.isLinux) { + if (bind.mainCurrentIsWayland()) { + return buildInstallCard( + "Warning", translate("wayland_experiment_tip"), "", () async {}, + help: 'Help', + link: 'https://rustdesk.com/docs/en/manual/linux/#x11-required'); + } else if (bind.mainIsLoginWayland()) { + return buildInstallCard("Warning", + "Login screen using Wayland is not supported", "", () async {}, + help: 'Help', + link: 'https://rustdesk.com/docs/en/manual/linux/#login-screen'); + } } - if (bind.mainIsInstalledLowerVersion()) {} return Container(); } diff --git a/res/lang.py b/res/lang.py index d1d4254ed..5aa6f4d15 100644 --- a/res/lang.py +++ b/res/lang.py @@ -16,7 +16,9 @@ def get_lang(lang): def line_split(line): toks = line.split('", "') - assert(len(toks) == 2) + if len(toks) != 2: + print(line) + assert(0) k = toks[0][2:] v = toks[1][:-3] return k, v @@ -34,7 +36,8 @@ def main(): def expand(): for fn in glob.glob('./src/lang/*'): lang = os.path.basename(fn)[:-3] - if lang in ['en','cn']: continue + if lang in ['en','cn']: continue + print(lang) dict = get_lang(lang) fw = open("./src/lang/%s.rs"%lang, "wt") for line in open('./src/lang/cn.rs'): diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 094a2faa7..23ba4ef4b 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -529,6 +529,7 @@ pub fn main_get_app_name() -> String { pub fn main_get_app_name_sync() -> SyncReturn<String> { SyncReturn(get_app_name()) } + pub fn main_get_license() -> String { get_license() } @@ -1207,6 +1208,14 @@ pub fn main_on_main_window_close() { crate::portable_service::client::drop_portable_service_shared_memory(); } +pub fn main_current_is_wayland() -> SyncReturn<bool> { + SyncReturn(current_is_wayland()) +} + +pub fn main_is_login_wayland() -> SyncReturn<bool> { + SyncReturn(is_login_wayland()) +} + #[cfg(target_os = "android")] pub mod server_side { use jni::{