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

2024-02-23 Thread Kevin Rushforth
On Fri, 23 Feb 2024 22:10:02 GMT, Michael Strauß  wrote:

> > 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
> 
> I haven’t tested this in combination with SWT, have you?

I just did and it works as expected (so no special-casing of an SWT application 
is needed).

-

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


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

2024-02-23 Thread Michael Strauß
On Mon, 19 Feb 2024 17:13:58 GMT, Anirvan Sarkar  wrote:

> 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

I haven’t tested this in combination with SWT, have you?

-

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


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

2024-02-23 Thread Michael Strauß
On Fri, 23 Feb 2024 20:14:43 GMT, Kevin Rushforth  wrote:

>> Michael Strauß has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   address review comments
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java
>  line 483:
> 
>> 481: 
>> 482: if (!AWT_SYSTEM_APPEARANCE.equals(awtAppearanceProperty)) {
>> 483: Logging.getJavaFXLogger().warning(String.format(
> 
> Minor: Maybe add newlines to break this message into two or three separate 
> lines?

Done. I've also moved the `checkSystemAppearance` assignment out of the if 
branch (it should be unconditionally set to `false` after the first call).

-

PR Review Comment: https://git.openjdk.org/jfx/pull/1367#discussion_r1501215285


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

2024-02-23 Thread Kevin Rushforth
On Sat, 17 Feb 2024 18:11:09 GMT, Michael Strauß  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

Looks good with one minor formatting suggestion (but I'll approve it as is).

modules/javafx.graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java 
line 483:

> 481: 
> 482: if (!AWT_SYSTEM_APPEARANCE.equals(awtAppearanceProperty)) {
> 483: Logging.getJavaFXLogger().warning(String.format(

Minor: Maybe add newlines to break this message into two or three separate 
lines?

-

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1367#pullrequestreview-1898861689
PR Review Comment: https://git.openjdk.org/jfx/pull/1367#discussion_r1501125311


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

2024-02-19 Thread Anirvan Sarkar
On Sat, 17 Feb 2024 18:11:09 GMT, Michael Strauß  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


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

2024-02-17 Thread Michael Strauß
> 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

-

Changes:
  - all: https://git.openjdk.org/jfx/pull/1367/files
  - new: https://git.openjdk.org/jfx/pull/1367/files/688b2f80..5c743df7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx=1367=02
 - incr: https://webrevs.openjdk.org/?repo=jfx=1367=01-02

  Stats: 15 lines in 2 files changed: 10 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jfx/pull/1367.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1367/head:pull/1367

PR: https://git.openjdk.org/jfx/pull/1367