#2206: Fix IDEasy title not properly shown on macOS - #2315
#2206: Fix IDEasy title not properly shown on macOS#2315Ali-Shariati-Najafabadi wants to merge 7 commits into
Conversation
Coverage Report for CI Build 32151631791Coverage increased (+0.04%) to 72.945%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions17 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
laim2003
left a comment
There was a problem hiding this comment.
Hi, thanks for the PR! Tested it on my mac and it works perfectly! Just added some thoughts that may improve this PR even more 😄
| * https://github.com/devonfw/IDEasy/issues/2292[#2292]: Questions appear twice | ||
| * https://github.com/devonfw/IDEasy/issues/825[#825]: Add commandlet for GC Log Analyzer | ||
| * https://github.com/devonfw/IDEasy/issues/1938[#1938]: GUI not launchable outside of project context | ||
| * https://github.com/devonfw/IDEasy/issues/2206[#2206]: IDEasy title not properly shown on macOS |
| // arrange | ||
| WindowsSymlinkTestHelper.assumeSymlinksSupported(); | ||
| IdeTestContext context = newContext(PROJECT_BASIC, null, true); | ||
| ((AbstractIdeTestContext) context).setSystemInfo(SystemInfoMock.MAC_ARM64); |
There was a problem hiding this comment.
The cast ((AbstractIdeTestContext) context) is redundant, as IdeTestContext extends AbstractIdeTestContext
| private static void writeFile(Path file, String content) { | ||
|
|
||
| try { | ||
| Files.writeString(file, content); | ||
| } catch (IOException e) { | ||
| throw new IllegalStateException("Failed to write file: " + file, e); | ||
| } | ||
| } |
There was a problem hiding this comment.
| private static void writeFile(Path file, String content) { | |
| try { | |
| Files.writeString(file, content); | |
| } catch (IOException e) { | |
| throw new IllegalStateException("Failed to write file: " + file, e); | |
| } | |
| } |
Redundant since we can use FileAccess's writeFileContent()
| Path contentsDir = this.context.getTempPath().resolve("IDEasy.app").resolve("Contents"); | ||
| Path launcher = contentsDir.resolve("MacOS").resolve("IDEasy"); | ||
| this.context.getFileAccess().mkdirs(launcher.getParent()); | ||
| writeFile(contentsDir.resolve("Info.plist"), GUI_INFO_PLIST); |
There was a problem hiding this comment.
Instead of creating our own helper method, we should be able to just use writeFileContent() from our exisitng FileAccess class.
| <key>CFBundleExecutable</key> | ||
| <string>IDEasy</string> | ||
| <key>CFBundleIdentifier</key> | ||
| <string>%s</string> |
There was a problem hiding this comment.
| <string>%s</string> | |
| <string>com.devonfw.tools.ideasy.gui</string> |
|
|
||
| private static final String GUI_APP_BUNDLE_ID = "com.devonfw.tools.ideasy.gui"; |
There was a problem hiding this comment.
| private static final String GUI_APP_BUNDLE_ID = "com.devonfw.tools.ideasy.gui"; |
If we hardcode the APP_BUNDLE_ID anyways?, why dont we just include it in the GUI_INFO_PLIST string?


This PR fixes #2206
Implemented changes:
ide guinow launches the JavaFX process through a symlink namedIDEasythat points to the realjavaexecutable, instead of exec-ingjavadirectly. macOS derives the Dock/menu bar title from the launched executable's filename (this GUI has no native app bundle), so this makes the title read "IDEasy" instead of "java". No-op on Windows/Linux.System.setProperty("apple.awt.application.name", "IDEasy")inApp.javawas tried and verified (by building and running the GUI locally) to have no effect, since this GUI is pure JavaFX (Glass toolkit) and that property is only read by AWT's toolkit.Testing instructions
ide gui(or build theguimodule and runcom.devonfw.ide.gui.AppLaunchervia the sameexec:execMaven invocation used by theguicommandlet).com.devonfw.tools.ide.tool.gui.GuiTestcover the executable resolution: a symlink namedIDEasyis created and used on macOS, while Windows/Linux keep using the plainjavaexecutable unchanged.Checklist for this PR
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary».In Progressand assigned to you or there is no issue (might happen for very small PRs)internalpom.xmlfiles or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc