-
Notifications
You must be signed in to change notification settings - Fork 507
8091629: [Mac] Support the automatic hiding of the "java" menu bar item when using the system menu bar #1737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back mfox! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
This should be discussed on the mailing list first. I recommend moving it to Draft for now. If it goes forward it will need a CSR. /reviewers 2 reviewers |
@kevinrushforth |
@kevinrushforth has indicated that a compatibility and specification (CSR) request is needed for this pull request. @beldenfox please create a CSR request for issue JDK-8091629 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@@ -0,0 +1,63 @@ | |||
/* | |||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. | |
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. |
@beldenfox I've tested the PR after solving the minor conflicts and it looks promising! |
@jperedadnr Thanks for taking a look! I'll go clean up the conflicts. My interest in this has cooled quite a bit. It's part of a bundle of other issues and I'm not sure it's worth fixing one without addressing the others. Another problem is that the system menu bar tracks the focused window so when all windows are iconified the menu bar goes away and the old default application menu re-appears. There's some existing logic that could fix that but it would have to be cleaned up and tested. The biggest problem is that when implicit exit is turned off the default Quit menu item stops working (there's a bug report on that already). Solving that means crafting an API for handling quit requests and that's more than I've been willing to take on right now. If I were a JavaFX developer on macOS I would probably pick up a third-party package that fixes all of these issues in one go (even if it works by digging around in the JavaFX internals). I'm not sure this isolated PR would be all that compelling. |
On the Mac the application menu (the one to the right of the Apple logo menu) is created by JavaFX and there is no public API to customize or localize it. This PR allows a client to get rid of it and replace it with an entirely custom JavaFX Menu.
Prior to OS X 10.6 (Snow Leopard) the application menu required special handling. Nowadays it's just the first item in the NSApp's mainMenu. The only restriction is that the OS ignores the item's title and instead uses the application's name as specified in the CFBundle.
This PR is a work-in-progress/trial balloon. It provides a new property on the MenuBar that controls whether the system will use the default menus. It also supplies the calls necessary to implement the standard menu items "Hide ", "Hide Others", and "Show All" which need to be routed to native calls on the NSApplication object. A manual test app is available in tests/manual/controls/DefaultAppMenu.java.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1737/head:pull/1737
$ git checkout pull/1737
Update a local copy of the PR:
$ git checkout pull/1737
$ git pull https://git.openjdk.org/jfx.git pull/1737/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1737
View PR using the GUI difftool:
$ git pr show -t 1737
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1737.diff
Using Webrev
Link to Webrev Comment