On Fri, 18 Apr 2025 20:24:20 GMT, Phil Race <p...@openjdk.org> wrote:

>> When trying to register an open URI handler when using JavaFX with a native 
>> menu, this task fails on Mac.
>> Either the native menu is not shown or the URIs are not received.
>> 
>> This pull request fixes this issue if AWT is registered after JavaFX, so 
>> that AWT runs embedded inside JavaFX.
>> It fixes this by introducing a native event to AWT, which can be used by 
>> JavaFX to forward events such as an openURL event.
>> 
>> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755
>> Co-Author: @FlorianKirmaier
>
> src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 
> 200:
> 
>> 198:     if (!self) return self;
>> 199: 
>> 200:     // register for the finish launching and system power off 
>> notifications by default
> 
> I assume there is a good reason that AWT only registered for these 
> notifications if IT is the main toolkit.
> The implications of changing this might be that it will try to handle events 
> that should be left to FX in the
> case that FX is the main toolkit.

Exactly, it only installs the handlers if it doesn't run embedded. 
But since JavaFX doesn't handle urls by itself, it still blocks AWT from 
receiving those events.
Therefore the only event for now that is forwarded to AWT is the url event.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2051489793

Reply via email to