Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Fix ICC profile detection not working per-monitor #724

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

jdpurcell
Copy link
Contributor

When I implemented the color space stuff, it was intended to have at least basic support for per-monitor ICC profiles. Specifically, even if it doesn't update in realtime as one drags the window to a different monitor, it should at least use the current monitor's ICC profile when loading a new image or reloading the current image. I remember testing this, but probably only on macOS, since just I discovered it wasn't working as intended on Windows. GetDC(hWnd) is apparently too simplistic of an approach and the result was always the same ICC profile regardless of which monitor the window was on (maybe it just returned the ICC profile for the default monitor). Even though all my monitors are the same model, I was able to test it by assigning a fake profile to one of them (this is handy for testing: SwappedRedAndGreen.zip).

Recommended to review the diff with "Hide whitespace" enabled.

@jurplel jurplel merged commit 909e013 into jurplel:master Oct 19, 2024
7 checks passed
@jdpurcell jdpurcell deleted the pr-winperdisplayicc branch October 19, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants