From 3cda0ebbb0889a949d5537bef21efc82aa24ca77 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 17 Nov 2026 12:20:08 +0800 Subject: [PATCH] fix(flutter): keep the DRM switch behind disable-settings, ask loginctl once per build disable-settings hides the Security tab but not General, so the Wayland card's checkbox and the home Enable button both stayed reachable on a locked custom client. With settings disabled the home page falls back to the stock Wayland warnings. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF --- .../lib/desktop/pages/desktop_home_page.dart | 28 ++++++++++--------- .../desktop/pages/desktop_setting_page.dart | 1 + 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index cd955efb0..eff9d3179 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -555,20 +555,22 @@ class _DesktopHomePageState extends State // DRM capture reaches the session and the login screen: no warning. } else if (drmSupported && !isOptionFixed(kOptionAllowDrmCapture) && - (bind.mainCurrentIsWayland() || bind.mainIsLoginWayland())) { + !bind.isDisableSettings()) { 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')); + if (currentIsWayland || bind.mainIsLoginWayland()) { + 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 {}, diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 8ca777e48..07b982164 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -2893,6 +2893,7 @@ class _WaylandCardState extends State { if (isLinux && bind.mainIsInstalled() && !bind.isOutgoingOnly() && + !bind.isDisableSettings() && bind.mainGetCommonSync(key: 'is-drm-capture-supported') == 'true') ...[ _OptionCheckBox(