<AWT Dev> [14] Review Request: 8231438 [macos] The dark mode is not supported yet
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Fri Sep 27 00:38:17 UTC 2019
Hello.
Please review the fix for JDK 14.
Bug: https://bugs.openjdk.java.net/browse/JDK-8231438
Fix: http://cr.openjdk.java.net/~serb/8231438/webrev.01
In jdk13 we started to use SDK 10.14 to build JDK, which automatically opt-in support of dark mode:
--------------
"The system assumes that apps linked against the macOS 10.14 or later SDK support both light and dark appearances"
https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app?language=objc
--------------
Unfortunately we dark mode still unsupported by the AWT/Swing, because of:
- JavaRuntimeSupport Framework which is used by the Aqua L&F to draw the "native"
appearance does not provide "dark mode" appearance, the bug is filed to Apple.
https://bugs.openjdk.java.net/browse/JDK-8228555
- In a few places, we mix the "native" colors used by the system and default colors
used by the Swing. For example, we may use a transparent white selection "native"
color which is invisible on top of white text fields.
While the bugs above are not fixed we may opt-out the dark mode:
-------------
Supporting Dark Mode is strongly encouraged. Use the NSRequiresAquaSystemAppearance key to opt out temporarily only while you work on improvements to your app's Dark Mode support. If you do not plan to support a dark appearance at all, apply a light appearance to your entire app, as described in Assign a Specific Appearance to Your App.
https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app?language=objc
-------------
I tried to disable it via plist.info but it does not work for "java -jar" case, so I disabled it in the code
Some constants in one test were updated to work on dark and light mode, but an updated test still reproduce the initial bug.
--
Best regards, Sergey.
More information about the awt-dev
mailing list