fix(drm): load the custom client before is_x11() can read Config, offer DRM only where it is compiled in

`IS_X11` now asks `drm_capture_enabled()`, which reads Config, and it is
computed in `global_init()`. `core_main()` ran that before
`load_custom_client()`, so on a Linux custom client the config loaded from
the stock "RustDesk" path before the app name was set and was never
reloaded; the root then synced that copy over the client's own settings.
Load the custom client first. On Windows and macOS `global_init()` does
nothing, so only the Linux startup order changes.

The DRM checkbox and the home-page "Enable" cards also showed on installed
builds without the drm feature (NixOS, source builds, --no-drm), where the
option has no effect. They now also need `is-drm-capture-supported`, a new
`main_get_common` key that reports whether drm is compiled in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
This commit is contained in:
rustdeskandClaude Opus 5.5 committed 2026-11-23 00:06:21 +08:00
1 parent c784ccf450
commit e6867a2fed
4 files changed
+14 -5

No files matched your search

@@ -549,10 +549,11 @@ class _DesktopHomePageState extends State<DesktopHomePage>
));
}
}
final installed = bind.mainIsInstalled();
if (installed && mainGetBoolOptionSync(kOptionAllowDrmCapture)) {
final drmSupported = bind.mainIsInstalled() &&
bind.mainGetCommonSync(key: 'is-drm-capture-supported') == 'true';
if (drmSupported && mainGetBoolOptionSync(kOptionAllowDrmCapture)) {
// DRM capture reaches the session and the login screen: no warning.
} else if (installed &&
} else if (drmSupported &&
!isOptionFixed(kOptionAllowDrmCapture) &&
(bind.mainCurrentIsWayland() || bind.mainIsLoginWayland())) {
final currentIsWayland = bind.mainCurrentIsWayland();
@@ -2890,7 +2890,11 @@ class _WaylandCardState extends State<WaylandCard> {
"true";
final children = [
if (isLinux && bind.mainIsInstalled() && !bind.isOutgoingOnly()) ...[
if (isLinux &&
bind.mainIsInstalled() &&
!bind.isOutgoingOnly() &&
bind.mainGetCommonSync(key: 'is-drm-capture-supported') ==
'true') ...[
_OptionCheckBox(
context, 'Use DRM screen capture', kOptionAllowDrmCapture),
Align(