This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 10dfac4f15bd954ea8d85e89e49edc6059683e56 Author: Andrus Adamchik <[email protected]> AuthorDate: Tue May 19 19:04:15 2026 -0400 A more robust "universal" Main on mac --- .../cayenne/modeler/platform/mac/MacUIInitializer.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/platform/mac/MacUIInitializer.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/platform/mac/MacUIInitializer.java index dcd14d482..637370458 100644 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/platform/mac/MacUIInitializer.java +++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/platform/mac/MacUIInitializer.java @@ -91,6 +91,16 @@ public class MacUIInitializer implements UIInitializer { @Override public void setupMenus(Application app, JFrame frame) { + // set additional look and feel for the window + frame.getRootPane().putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE); + + // Only relocate About/Preferences/Quit to the macOS application menu when the + // screen menu bar is actually in use. Otherwise the JMenuBar stays inside the + // window frame, and stripping these items would make them inaccessible. + if (!Boolean.getBoolean("apple.laf.useScreenMenuBar")) { + return; + } + GlobalActions globalActions = app.getActionManager(); Desktop desktop = Desktop.getDesktop(); @@ -104,9 +114,6 @@ public class MacUIInitializer implements UIInitializer { } }); - // set additional look and feel for the window - frame.getRootPane().putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE); - Set<Action> removeActions = new HashSet<>(); removeActions.add(globalActions.getAction(ExitAction.class)); removeActions.add(globalActions.getAction(AboutAction.class));
