RFR: 8325900: Emit a warning on macOS if AWT has set the NSAppearance [v3]

Anirvan Sarkar asarkar at openjdk.org
Mon Feb 19 17:17:01 UTC 2024


On Sat, 17 Feb 2024 18:11:09 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Platform preferences detection doesn't pick up effective macOS system preferences if AWT owns the NSApplication and has set its NSAppearance to a fixed value.
>> 
>> The workaround is to set the system property "apple.awt.application.appearance=system".
>> 
>> If this property is not set, the following warning will be emitted if a JavaFX application attempts to use the platform preferences API:
>> 
>> 
>> WARNING: Reported preferences may not reflect the macOS system preferences unless the sytem
>> property apple.awt.application.appearance=system is set. This warning can be disabled by
>> setting javafx.preferences.suppressAppleAwtWarning=true.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
> 
>   address review comments

> Platform preferences detection doesn't pick up effective macOS system preferences if AWT owns the NSApplication and has set its NSAppearance to a fixed value.

What about SWT ?
It looks like SWT also supports dark mode since version 4.12 [1][2].

[1] : https://eclipse.dev/eclipse/news/4.12/platform_isv.php#dark-theme-mac
[2] : https://bugs.eclipse.org/bugs/show_bug.cgi?id=540357

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1367#issuecomment-1952905143


More information about the openjfx-dev mailing list