JDK-8228555 : [macos] [dark_mode] The text on the various components is not visible on DarkMode
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
To reproduce the problem the next example can be used:
See screenshot of the result
Apple confirmed they are working on this issue.
Apple bugID: FB6798883: The JavaRuntimeSupport.framework does not work properly in the dark mode
still reproducible on Beta macOS 10.15.3
[~serb] is it still reproducible on the latest macOS build?
[~serb] does it affect Catalina 10.15.2 Beta (19C46a) ?
[~serb] this list https://bugs.openjdk.java.net/secure/attachment/85149/fail.txt needs to be mapped on CRs unless all of them caused by "The text on the various components is not visible on DarkMode" Issue
total 47 tests failing due to DARK mode
This mode might be supported in case (1) SQE test cycle completed; (2) all critical issues including tck-red bugs fixed on java side (no one so far); (3) Apple's bugs fixed on macOS side (like this FB6798883: The JavaRuntimeSupport.framework does not work properly in the dark mode ),
so removing tck-red label.
Reproduced on macOS Mojave in DarkMode as well.
We can try to opt out the dark mode, according to the doc it should be possible:
But the change in the plist.info is ignored, will try to do the same in the code itself.
Just found another place where we mix colors from the different modes: JDK-8231386. Looks like we should either fully support the dark mode and its native colors or we need to ignore all system colors and use some hardcoded one.
In macOS, there is an API which reports the colors currently used by the system, but when we actually draw something via JRS the color used as the background color of the component is different.
> since the system reports one dark background color but use white color as a background.
Can you explain that in more depth ? It sounds contradictory, what do you mean by "reports" versus "uses" ?
We cannot do exactly what we did in JDK-8226964 since the system reports one dark background color but use white color as a background.
We can revert the "change" of the font color(caused by the SDK upgrade), and ignore the system configuration and always return black as it was in jdk12, or probably freeze all colors to prevent mix of different styles(white/dark) .
Can we do something similar to what we had to do with GTK3 ?
FB6798883: The JavaRuntimeSupport.framework does not work properly in the dark mode
The bug is reproduced on the macOS 10.15 which is still in beta state and required a fix in the JRS, the bug was submitted to the Apple.
It works on jdk12 because of the crossing of two similar bugs in JDK:
- The color of the text is incorrect in dark mode(black instead of white).
- The JRS does not support the dark mode so the white button background is drawn.
In jdk13 we start to use correct text color, but the JRS still return incorrect background, as a result, the text is invisible.
I have filed the bug to the Apple against JRS, but we have a dilemma here when this bug will be fixed the jdk12(and below) will be broken as it will use the black text on the dark background.
Only 13 and 14 are affected, I guess due to SDK upgrade.