-
Notifications
You must be signed in to change notification settings - Fork 22
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
Mac menu items use class name, instead of program name #127
Comments
I inadvertently fixed this by adding the following System property:
I'm not sure, however, of the difference between the above System Property and:
which I was already using. Maybe the first one is newer. Anyway, I'm glad I got this working |
Is this ticket still an issue? If not, can you close it? Or is there something we can do to streamline this one? Really, to me it seems like getting the right application name should be something |
Firstly, thank you @hakanai for stepping up, to help with this project. As for this issue, the problem still exists as described. If I don't include System.setProperty("apple.awt.application.name", "PWMinder" ); when I run the .app bundle, created by jpackage (using the plugin), the About and Quit Menu Items say "MainProgram". Setting the property does "fix" this, but I'm not sure if that means this issue should be closed or not. |
It's gonna be one of 3 possibilities:
So from here, I'd have to get on a Mac and play with jpackage a bit to see if I can figure out how it's supposed to happen. It really seems like they should be doing it out of the box, but maybe this plugin isn't setting the application name or something. Setting the application name should really affect Windows and Linux as well... for Windows you'd want the executable name to match, and probably the metadata inside the executable. Even for Linux, there is some kind of desktop shortcut file which should be named after the application. What's weird though is, the name is right for the menu itself. |
I've done some testing on macOS, and the findings:
So the first thing to note is that it behaves differently depending on whether the app is Swing or JavaFX. Running with
So the custom name specified in |
Digging in the code...
So it looks to me like there are 2 possibilities for the fix:
I don't know which one is the closer to the original intent so I'll let @siordache choose which way to go. Maybe there's some code setting up |
Thanks for your diligent work, especially for finding the difference between JavaFX and Swing. I also, just wanted to confirm, that the application I found this for, is a Swing application, which seems to match with the findings you described. |
Looks like I'm somewhat confused as well. It turns out there are two properties to set, both in the
Neither of these fall back to the That said, the current behaviour matches the docs perfectly. So in that sense at least it was behaving correctly. But, the application plugin's mainClass value is used by this plugin as a default for that, so it makes sense for this corresponding value to be treated similarly. Currently testing this stuff to see if updates to the code actually work in a real project seems to be difficult because the Gradle versions don't match between all the sample projects and this project - and it looks like the version of Gradle being used by this project isn't new enough for JDK17, which adds to the mess. I'm trying to do something about that but it's Groovy so it's slow going... |
…allerName. applicationName is intended to be the display name of the application, so it makes sense for this to be used by default. Intended to fix beryx#127 but needs testing on macOS to be absolutely certain.
I am creating a .app image for macOS. Everything works fine, but when I run the application, and click on the Mac Menu, the About, and Quit menu items use the main class name, instead of the Application name (see screen shot):
So the actual menu name show correctly as PWMinder, but the About and Quit using 'MainProgram' instead of 'PWMinder'. Note: the Dock name is also correct.
Below is relevant part of my build script:
and below is the generated info.plist:
I was previously using ant and appbundler, and using that setup I used to be able to the that About and Quit to show correctly, but I'm now trying to upgrade my build tools to using Gradle and JLink/JPackage.
I'm not sure if this is a problem with jpackage or with the plug-in, or if I've configured something incorrectly.
Any help or insight would be appreciated.
The text was updated successfully, but these errors were encountered: