On Thu, 2 Jul 2026 15:16:02 GMT, Martin Fox <[email protected]> wrote:

>> This PR provides an API for replacing the application menu that JavaFX 
>> places in the system menu bar on macOS. The application menu is the one next 
>> to the Apple menu that is titled with the application's name and contains 
>> the Quit menu item. The JavaFX version of this menu has many limitations so 
>> this PR allows a developer to simply replace it outright.
>> 
>> Technically there’s no reason to restrict this to only one menu so the API 
>> allows the developer to specify an observable list of Menus known as the 
>> common system menus. Like the current application menu the common menus are 
>> present for all JavaFX windows and remain present even if all windows lose 
>> focus. Any per-window menus provided by a MenuBar with useSystemMenuBar set 
>> will appear alongside the common system menus.
>> 
>> In addition the PR provides some calls that allow a developer to implement 
>> the Hide <app name>, Hide Others, and Show All menu items that are expected 
>> in the application menu.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Martin Fox has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Added manual test app

I don't have a good answer for this. The application menu and its standard menu 
items (like "Hide Others") are very specific to the Mac so anything we do in 
this area will be platform-specific. AWT provides a set of functions for 
customizing aspects of the application menu which is designed to look platform 
agnostic but which only works on the Mac. JavaFX could engage in similar API 
pageantry but I don't see the point. Personally I would rather just turn these 
calls into no-ops on other platforms and let developers ignore them as 
appropriate.

In any case coming to a consensus on how to handle these calls requires more 
voices in the conversation.

> 1. implement it as a library outside of javafx

In that case I would just skip this PR entirely. There are already third-party 
libraries for handling Mac menus. They're not drop-in replacements for the 
existing MenuBar API but they cover a lot more ground.

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

PR Comment: https://git.openjdk.org/jfx/pull/1881#issuecomment-5079859297

Reply via email to