From 2705228394453d7c2e2fc00ec713f17cee4b3797 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sat, 7 May 2022 22:47:43 +0800 Subject: [PATCH] https://github.com/rustdesk/rustdesk/issues/477 --- src/lang/en.rs | 1 + src/ui.rs | 8 ++++++-- src/ui/index.css | 3 ++- src/ui/index.tis | 13 ++++++++++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/lang/en.rs b/src/lang/en.rs index 31b6cd2ee..d389cdb6b 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -25,5 +25,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("android_version_audio_tip", "The current Android version does not support audio capture, please upgrade to Android 10 or higher."), ("android_start_service_tip", "Tap [Start Service] or OPEN [Screen Capture] permission to start the screen sharing service."), ("doc_mac_permission", "https://rustdesk.com/docs/en/manual/mac/#enable-permissions"), + ("doc_fix_wayland", "https://rustdesk.com/docs/en/manual/linux/#x11-required"), ].iter().cloned().collect(); } diff --git a/src/ui.rs b/src/ui.rs index 47b1968b9..da3348c1c 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -663,8 +663,12 @@ impl UI { let p = "explorer"; #[cfg(target_os = "macos")] let p = "open"; - #[cfg(target_os = "linux")] - let p = "xdg-open"; + #[cfg(target_os = "linux")] + let p = if std::path::Path::new("/usr/bin/firefox").exists() { + "firefox" + } else { + "xdg-open" + }; allow_err!(std::process::Command::new(p).arg(url).spawn()); } diff --git a/src/ui/index.css b/src/ui/index.css index f0286c4ba..a71de4848 100644 --- a/src/ui/index.css +++ b/src/ui/index.css @@ -352,7 +352,8 @@ div.trust-me > div:nth-child(3) { font-weight: bold; } -div.trust-me > div:nth-child(4) { +div.trust-me > div:nth-child(4), +div.trust-me > div:nth-child(5) { margin-top: 0.5em; text-align: center; } diff --git a/src/ui/index.tis b/src/ui/index.tis index f5391b941..a77746c56 100644 --- a/src/ui/index.tis +++ b/src/ui/index.tis @@ -584,6 +584,7 @@ class FixWayland: Reactor.Component {
{translate('Warning')}
{translate('Login screen using Wayland is not supported')}
{translate('Fix it')}
+
{translate('Help')}
({translate('Reboot required')})
; } @@ -592,6 +593,10 @@ class FixWayland: Reactor.Component { handler.fix_login_wayland(); app.update(); } + + event click $(#help-me) { + handler.open_url(translate("doc_fix_wayland")); + } } class ModifyDefaultLogin: Reactor.Component { @@ -600,16 +605,22 @@ class ModifyDefaultLogin: Reactor.Component {
{translate('Warning')}
{translate('Current Wayland display server is not supported')}
{translate('Fix it')}
+
{translate('Help')}
({translate('Reboot required')})
; } event click $(#modify-default-login) { if (var r = handler.modify_default_login()) { - msgbox("custom-error", "Error", r); + // without handler, will fail, fucking stupid sciter + handler.msgbox("custom-error", "Error", r); } app.update(); } + + event click $(#help-me) { + handler.open_url(translate("doc_fix_wayland")); + } } function watch_trust() {