Bug 565967 - Selection is not always readable on macOS
Summary: Selection is not always readable on macOS
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.16   Edit
Hardware: All Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-10 13:49 EDT by Pierre-Yves Bigourdan CLA
Modified: 2022-02-22 10:14 EST (History)
4 users (show)

See Also:


Attachments
Unreadable text selection in compare editor (281.48 KB, image/png)
2020-08-10 13:49 EDT, Pierre-Yves Bigourdan CLA
no flags Details
Hard to read text selection in save actions list (280.11 KB, image/png)
2020-08-24 11:51 EDT, Pierre-Yves Bigourdan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Yves Bigourdan CLA 2020-08-10 13:49:01 EDT
Created attachment 283825 [details]
Unreadable text selection in compare editor

On macOS, some text areas seem to ignore the selection foreground and background colors defined by CSS themes.

I've noticed this in at least two places:
* when using the default compare editor.
* when using the Subclipse plugin (https://github.com/subclipse/subclipse) and selecting text in the commit message dialog.

Attached is a screenshot of the first case when using the built-in Dark theme. As you can see, selected text is unreadable when comparing two files for example.

Note that I'm using macOS Catalina 10.15.6 with Openjdk 11.0.8 2020-07-14.
Comment 1 Pierre-Yves Bigourdan CLA 2020-08-24 11:51:01 EDT
Created attachment 283953 [details]
Hard to read text selection in save actions list

Another place where this is noticeable: the save actions list from the JDT UI preferences.
Comment 2 Ingo Mohr CLA 2020-10-29 14:00:41 EDT
The effects are still the same with the standard dark theme on:

Build id: I20201028-0800
macOS 11: 11.0.1 Beta (20B5012d)
Comment 3 Lars Vogel CLA 2021-10-01 07:43:44 EDT
Sounds like this is an SWT issue.
Comment 4 Lakshmi P Shanmugam CLA 2022-02-21 11:05:40 EST
I see the correct selection background color in SWT in dark theme, but the color used in Eclipse is that of light theme. Is it related to Bug 577912?
Comment 5 Thomas Wolf CLA 2022-02-21 18:34:41 EST
(In reply to Lakshmi P Shanmugam from comment #4)
> I see the correct selection background color in SWT in dark theme, but the
> color used in Eclipse is that of light theme. Is it related to Bug 577912?

I don't think so. I see this in the text compare (selection background light blue), but not in the Java compare (dark blue).
Comment 6 Thomas Wolf CLA 2022-02-22 02:29:20 EST
On second thought, perhaps it is. Is bug 531820 also related?
Comment 7 Lakshmi P Shanmugam CLA 2022-02-22 06:56:07 EST
(In reply to Thomas Wolf from comment #6)
> On second thought, perhaps it is. Is bug 531820 also related?

Yes, the problem is that SWT color constant being returned is of light theme though Eclipse is in dark theme.
Comment 8 Thomas Wolf CLA 2022-02-22 07:15:43 EST
(In reply to Lakshmi P Shanmugam from comment #7)
> (In reply to Thomas Wolf from comment #6)
> > On second thought, perhaps it is. Is bug 531820 also related?
> 
> Yes, the problem is that SWT color constant being returned is of light theme
> though Eclipse is in dark theme.

But why only in text compare but not in Java compare?
Comment 9 Lakshmi P Shanmugam CLA 2022-02-22 10:14:47 EST
(In reply to Thomas Wolf from comment #8)
> (In reply to Lakshmi P Shanmugam from comment #7)
> > (In reply to Thomas Wolf from comment #6)
> > > On second thought, perhaps it is. Is bug 531820 also related?
> > 
> > Yes, the problem is that SWT color constant being returned is of light theme
> > though Eclipse is in dark theme.
> 
> But why only in text compare but not in Java compare?

In Bug 531820, JDISourceViewer uses constants from AbstractTextEditor for background and foreground instead of SWT Color constants. JavaBreakpointConditionEditor was using a SWT Color constant and was removed to fix the problem. 
Could be similar for Java compare where different color constants for selection background are used.