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

Inconsistencies in NSColor usage creates a GUI bug for users with specialized Display Settings #14482

Closed
wxtrac opened this issue Jul 13, 2012 · 5 comments
Labels
low priority macOS Specific to Cocoa macOS port v3.0

Comments

@wxtrac
Copy link
Collaborator

wxtrac commented Jul 13, 2012

Issue migrated from trac ticket # 14482

component: wxOSX | priority: low | resolution: fixed

2012-07-13 04:15:42: kjones@cedrus.com (Kelly Jones) created the issue


The number of users that will notice this bug is probably small.

However, the fix is extremely simple and straightforward.

Most portions of the wx Cocoa codebase use: [NSColor colorWithCalibratedRed:]

Only two spots use: [NSColor colorWithDeviceRed:]

I recommend that everything use colorWithCalibratedRed. A patch is attached.

I am attaching a screenshot showing the discoloration problem that becomes apparent in a wxTextCtrl on a mac computer where someone has used "System Preferences >> Displays >> Color" to configure custom ICC Profiles (in ~/Library/ColorSync/Profiles/). What should have happened to my wxTextCtrl is that there should be a single uniform background color, and only the text lettering should be a different color. What is actually shown (the bug) is that there are two background colors. There is one background color showing where no text has reached, and there is another background color behind each typed letter.

The reason for the "two different background colors" is that 'wxWidgetCocoaImpl::SetBackgroundColour' uses 'colorWithCalibratedRed' to take care of the background of the wxTextCtrl where no text letters have been typed, and then 'wxNSTextViewControl::SetStyle' uses 'colorWithDeviceRed' (via a call to wxColour::OSXGetNSColor) to get a slightly different background behind the lettering.

Again, this only becomes apparent on desktops where 'DeviceRed' and 'CalibratedRed' are actually different, which involves tweaking Display settings in System Preferences.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Jul 13, 2012

2012-07-13 04:16:30: kjones@cedrus.com (Kelly Jones) uploaded file textctrl_bgcolor.png (28.4 KiB)

this screenshot shows the bug: two background colors
textctrl_bgcolor.png

@wxtrac
Copy link
Collaborator Author

wxtrac commented Jul 13, 2012

2012-07-13 04:16:57: kjones@cedrus.com (Kelly Jones) uploaded file mac_display_settings.png (69.0 KiB)

this screenshot shows the relevant system settings
mac_display_settings.png

@wxtrac
Copy link
Collaborator Author

wxtrac commented Jul 13, 2012

2012-07-13 04:18:12: kjones@cedrus.com (Kelly Jones) uploaded file osx_color_fix_CalibratedRed.patch (0.9 KiB)

@wxtrac
Copy link
Collaborator Author

wxtrac commented Jul 13, 2012

2012-07-13 08:06:14: @csomor changed status from new to accepted

@wxtrac
Copy link
Collaborator Author

wxtrac commented Jul 13, 2012

2012-07-13 08:51:05: @csomor changed status from accepted to closed

2012-07-13 08:51:05: @csomor set resolution to fixed

2012-07-13 08:51:05: @csomor commented

(In [72065]) always use calibrated colors, fixes #14482

@wxtrac wxtrac closed this as completed Jul 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority macOS Specific to Cocoa macOS port v3.0
Projects
None yet
Development

No branches or pull requests

1 participant