wayland tip

This commit is contained in:
rustdesk 2022-12-04 18:39:59 +08:00
parent 3c584a7c01
commit 3f009a3bc7
3 changed files with 35 additions and 13 deletions

View File

@ -301,15 +301,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
} }
Widget buildHelpCards() { 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) { if (updateUrl.isNotEmpty) {
return buildInstallCard( return buildInstallCard(
"Status", "Status",
@ -322,7 +313,15 @@ class _DesktopHomePageState extends State<DesktopHomePage>
if (systemError.isNotEmpty) { if (systemError.isNotEmpty) {
return buildInstallCard("", systemError, "", () {}); 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)) { if (!bind.mainIsCanScreenRecording(prompt: false)) {
return buildInstallCard("Permissions", "config_screen", "Configure", return buildInstallCard("Permissions", "config_screen", "Configure",
() async { () async {
@ -342,8 +341,19 @@ class _DesktopHomePageState extends State<DesktopHomePage>
bind.mainIsInstalledDaemon(prompt: true); 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(); return Container();
} }

View File

@ -16,7 +16,9 @@ def get_lang(lang):
def line_split(line): def line_split(line):
toks = line.split('", "') toks = line.split('", "')
assert(len(toks) == 2) if len(toks) != 2:
print(line)
assert(0)
k = toks[0][2:] k = toks[0][2:]
v = toks[1][:-3] v = toks[1][:-3]
return k, v return k, v
@ -35,6 +37,7 @@ def expand():
for fn in glob.glob('./src/lang/*'): for fn in glob.glob('./src/lang/*'):
lang = os.path.basename(fn)[:-3] lang = os.path.basename(fn)[:-3]
if lang in ['en','cn']: continue if lang in ['en','cn']: continue
print(lang)
dict = get_lang(lang) dict = get_lang(lang)
fw = open("./src/lang/%s.rs"%lang, "wt") fw = open("./src/lang/%s.rs"%lang, "wt")
for line in open('./src/lang/cn.rs'): for line in open('./src/lang/cn.rs'):

View File

@ -529,6 +529,7 @@ pub fn main_get_app_name() -> String {
pub fn main_get_app_name_sync() -> SyncReturn<String> { pub fn main_get_app_name_sync() -> SyncReturn<String> {
SyncReturn(get_app_name()) SyncReturn(get_app_name())
} }
pub fn main_get_license() -> String { pub fn main_get_license() -> String {
get_license() get_license()
} }
@ -1207,6 +1208,14 @@ pub fn main_on_main_window_close() {
crate::portable_service::client::drop_portable_service_shared_memory(); 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")] #[cfg(target_os = "android")]
pub mod server_side { pub mod server_side {
use jni::{ use jni::{