diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 2b0d2c7d1..d81b904c5 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -105,6 +105,7 @@ const String kOptionAutoDisconnectTimeout = "auto-disconnect-timeout"; const String kOptionEnableHwcodec = "enable-hwcodec"; const String kOptionAllowAutoRecordIncoming = "allow-auto-record-incoming"; const String kOptionAllowAutoRecordOutgoing = "allow-auto-record-outgoing"; +const String kOptionAllowDrmCapture = "allow-drm-capture"; const String kOptionHideRecordingButton = "hide-recording-button"; const String kOptionVideoSaveDirectory = "video-save-directory"; const String kOptionAccessMode = "access-mode"; diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index e6f5a41aa..0917f9534 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -549,7 +549,26 @@ class _DesktopHomePageState extends State )); } } - if (bind.mainCurrentIsWayland()) { + final installed = bind.mainIsInstalled(); + if (installed && mainGetBoolOptionSync(kOptionAllowDrmCapture)) { + // DRM capture reaches the session and the login screen: no warning. + } else if (installed && + !isOptionFixed(kOptionAllowDrmCapture) && + (bind.mainCurrentIsWayland() || bind.mainIsLoginWayland())) { + final currentIsWayland = bind.mainCurrentIsWayland(); + LinuxCards.add(buildInstallCard( + "Warning", + currentIsWayland ? "wayland-drm-tip" : "login-wayland-drm-tip", + "Enable", () async { + await mainSetBoolOption(kOptionAllowDrmCapture, true); + setState(() {}); + }, + marginTop: LinuxCards.isEmpty ? 20.0 : 5.0, + help: 'Help', + link: currentIsWayland + ? 'https://rustdesk.com/docs/en/client/linux/#x11-required' + : 'https://rustdesk.com/docs/en/client/linux/#login-screen')); + } else if (bind.mainCurrentIsWayland()) { LinuxCards.add(buildInstallCard( "Warning", "wayland_experiment_tip", "", () async {}, marginTop: LinuxCards.isEmpty ? 20.0 : 5.0, diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 730d75827..6d9a1a527 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -2890,6 +2890,14 @@ class _WaylandCardState extends State { "true"; final children = [ + if (isLinux && bind.mainIsInstalled() && !bind.isOutgoingOnly()) ...[ + _OptionCheckBox( + context, 'Use DRM screen capture', kOptionAllowDrmCapture), + Align( + alignment: Alignment.topLeft, + child: Text(translate('drm-capture-tip')), + ).marginOnly(left: _kCardLeftMargin), + ], if (restoreToken.isNotEmpty) _buildClearScreenSelection(context, restoreToken), if (hasShortcutsPermission)