From 6a707408401e9ed8181cf898ed0ab1435c7300a2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 08:33:03 +0000 Subject: [PATCH] Linux display server: compile read_display_server on Linux (and tests) only macOS and Windows clippy rejected it as dead code (-D warnings): its only caller in main.rs is #[cfg(target_os = "linux")]. Also puts read_rendering_prefs' doc line back above it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA --- apps/photocraft/src/gpu_startup.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/photocraft/src/gpu_startup.rs b/apps/photocraft/src/gpu_startup.rs index 5907ca7bde..963a3fa3ad 100644 --- a/apps/photocraft/src/gpu_startup.rs +++ b/apps/photocraft/src/gpu_startup.rs @@ -408,9 +408,9 @@ impl Sentinel { } } -/// Read the policy leniently at startup, including old settings without renderingMode. /// The Linux display-server preference (`performance.linuxDisplayServer`) from the preferences /// file, read before the window opens; `Auto` when the file or value is missing or unknown. +#[cfg(any(target_os = "linux", test))] pub fn read_display_server(path: Option<&Path>) -> photocraft_engine::prefs::LinuxDisplayServer { let v: Value = path.and_then(|p| std::fs::read_to_string(p).ok()).and_then(|t| serde_json::from_str(&t).ok()).unwrap_or(Value::Null); v.get("performance") @@ -419,6 +419,7 @@ pub fn read_display_server(path: Option<&Path>) -> photocraft_engine::prefs::Lin .unwrap_or_default() } +/// Read the policy leniently at startup, including old settings without renderingMode. pub fn read_rendering_prefs(path: Option<&Path>) -> (GpuBackend, RenderingMode) { let v: Value = path.and_then(|p| std::fs::read_to_string(p).ok()).and_then(|t| serde_json::from_str(&t).ok()).unwrap_or(Value::Null); let perf = v.get("performance");