mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-12 17:00:37 -06:00
While no monitor profile is chosen in Settings > Display, Windows now shows previews through the profile Windows Color System assigns to the monitor showing the window (per-user or system), as macOS and Linux already do. It is read about once a second, so moving the window to another monitor and changing the profile in Windows are followed without a restart. While Windows colour-manages the desktop itself (HDR, Auto Color Management), previews stay sRGB. The Win32 calls live in a new L0 helper crate, crates/wincolor, the second crate allowed `unsafe` after crates/sysmem (SAFETY comments on every block, safe API, Unknown on any failure); CLAUDE.md and AGENTS.md name it. GDI's GetICMProfileW keeps the profile a process first saw, so WCS is read directly and GetICMProfileW is only a fallback. The profile-file loader moves from the Linux-only colord.rs to a shared profile_file.rs (unchanged), with a cache that re-reads a file only when it changes. Verified on Windows 11 by setting and clearing a Display P3 profile and toggling HDR while the app ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K93HTyCiwYvbRGaAkjPvXn