| Summary: | [Cocoa] "Selection foreground color" preference not used | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Adam Clark <adam.h.clark> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | bjoern.pollex, daniel_megert, markus.kell.r, remy.suen |
| Version: | 3.7.1 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| Whiteboard: | stalebug | ||
|
Description
Adam Clark
Looks okay to me with I20120216-2200 on Windows 7. I downloaded build I20120216-2200 and the problem persisted. I wound up running the Eclipse debug, and tracked this down to the SWT library at plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.8.0.v3821b.jar Starting at org.eclipse.swt.graphics.TextLayout.java:484 it uses gc.data.foreground / gc.data.fg to set the color in the layoutManager, ignoring the passed-in selectionForeground. Running in the debugger, executing gc.setForeground(selectionForeground); NSColor fg = gc.data.fg = NSColor.colorWithDeviceRed(selectionForeground.handle[0], selectionForeground.handle[1], selectionForeground.handle[2], selectionForeground.handle[3]); fg.retain(); caused the correct foreground color to be used. I don't know the system well enough to suggest a patch, though. I am currently encountering this bug as well on Eclipse 4.2.2 running on Mac OS X 10.10.3. Is there any fix in sight? (In reply to Bjoern Pollex from comment #3) > Is there any fix in sight? Not really, and I'm not even sure there's actually anything to fix. On Windows and GTK, a selection uses a different selection foreground color and overrides any non-default text color. On Mac OS X, selections only change the background color but retain the foreground color of selected text. E.g. in TextEdit as well as in the Eclipse Java editor, colorized text keeps the color when selected. The "Selection foreground color" is not used. This is platform behavior that we don't plan to change. > This is platform behavior that we
> don't plan to change.
I don't see how this isn't a bug. The user can set the "selection foreground color" in the preferences, but it's not used for the selection foreground color. This seems like a clear case of the software failing its side of the contract.
And again, the "typical" selection scheme is inverted, eg. uses the normal foreground color as background and vice versa. By inverting the background color but retaining the normal foreground color, this issue renders all selected text invisible. In practice, this is a pretty big usability problem.
Yes, the existence of a preference that doesn't do anything is a bug.
Unfortunately, SWT has to make a trade-off between adhering to platform conventions and offering a 100% portable API.
> the "typical" selection scheme is inverted
Not on the Mac. Here, the typical scheme is to have a selection background color that is close to the non-selection background color. For bright-on-dark color schemes, you have to choose a dark selection background color.
I've come across this because I have been trying to setup the Solarized color scheme in Eclipse. I have the same color scheme set up for both Emacs and PyCharm, both of which use inverted color when highlighting text, so it is apparently possible. I fully understand that it may be too difficult to change though. Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more information. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |