mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-26 23:57:33 +00:00
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:
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(
|
||||
|
||||
+3
-1
@@ -43,10 +43,12 @@ fn finish_macos_update(result: hbb_common::ResultType<()>) -> Option<CoreMainAct
|
||||
/// If it returns [`Some`], the action determines whether to start the UI or report failure.
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn core_main() -> Option<CoreMainAction> {
|
||||
// Before global_init: on Linux its is_x11() can read Config (allow-drm-capture), and Config
|
||||
// loads from a path named after the custom client's app name.
|
||||
crate::load_custom_client();
|
||||
if !crate::common::global_init() {
|
||||
return None;
|
||||
}
|
||||
crate::load_custom_client();
|
||||
#[cfg(windows)]
|
||||
if !crate::platform::windows::bootstrap() {
|
||||
// return None to terminate the process
|
||||
|
||||
@@ -2780,6 +2780,8 @@ pub fn main_get_common(key: String) -> String {
|
||||
return crate::platform::is_win_10_or_greater().to_string();
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
return false.to_string();
|
||||
} else if key == "is-drm-capture-supported" {
|
||||
return cfg!(all(target_os = "linux", feature = "drm")).to_string();
|
||||
} else if key == "transfer-job-id" {
|
||||
return base::fs::get_next_job_id().to_string();
|
||||
} else if key == "is-remote-modify-enabled-by-control-permissions" {
|
||||
|
||||
Reference in new issue
Block a user