Skip to content

Commit

Permalink
Handle non-sRGB displays on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rianmcguire authored and wez committed Sep 14, 2024
1 parent 3fc45ca commit 024a8ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions window/src/os/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ impl Window {
window.setReleasedWhenClosed_(NO);
window.setBackgroundColor_(cocoa::appkit::NSColor::clearColor(nil));

// Tell Cocoa that we output in sRGB, so it handles color space
// conversion for non-sRGB displays.
window.setColorSpace_(cocoa::appkit::NSColorSpace::sRGBColorSpace(nil));

// We could set this, but it makes the entire window, including
// its titlebar, opaque to this fixed degree.
// window.setAlphaValue_(0.4);
Expand Down

0 comments on commit 024a8ee

Please sign in to comment.