On Fri, 10 Nov 2023 14:07:23 GMT, Kevin Rushforth <[email protected]> wrote:

>> src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m line 844:
>> 
>>> 842:     }
>>> 843: 
>>> 844:     if (menuBar == nil && [ApplicationDelegate sharedDelegate] != nil) 
>>> {
>> 
>> Can you please provide details on how the delegate can be null here and 
>> there if it should be set at the startup of any awt application?
>
> It can be null if the NSApplication was created by code outside of AWT. 
> Specifically, in the case of an FX or SWT toolkit, but in theory a native 
> application using JAWT could do this.
> 
> In practice, since we haven't even seen a crash as a result of this, I doubt 
> that this code is ever called if AWT isn't running the event loop and hasn't 
> installed their delegate.

To access any native code in AWT the app should initially init the LWCToolkit 
which sets that application delegate if it is not set already. Do we know how 
the FX can bypass that initialization?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16569#discussion_r1389938434

Reply via email to