fix(core_main): load the custom client early only with drm

Only a Linux drm build reads Config in global_init (the IS_X11 greeter
override reads allow-drm-capture), so only there must the custom client
load first. Every other build keeps master's order.

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:26 +08:00
1 parent eebb4f94db
commit 4987da017a
1 file changed
+11 -7
+11 -7
View File
@@ -43,17 +43,21 @@ 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> {
// global_init's first two steps, run early for the custom client: its signature check uses
// libsodium, and the probe child must not get past its dispatch. global_init repeats both.
crate::common::init_sodium();
// Before global_init: with drm its is_x11() can read Config (allow-drm-capture), and Config
// loads from a path named after the custom client's app name. global_init's first two steps
// run first, for the custom client: its signature check uses libsodium, and the probe child
// must not get past its dispatch. global_init repeats both.
#[cfg(all(target_os = "linux", feature = "drm"))]
crate::platform::linux::dispatch_wayland_display_probe();
// 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();
{
crate::common::init_sodium();
crate::platform::linux::dispatch_wayland_display_probe();
crate::load_custom_client();
}
if !crate::common::global_init() {
return None;
}
#[cfg(not(all(target_os = "linux", feature = "drm")))]
crate::load_custom_client();
#[cfg(windows)]
if !crate::platform::windows::bootstrap() {
// return None to terminate the process