Skip to content

Commit eed7066

Browse files
committed
find a workaround for Help menu bug on macOS (fixes #638)
1 parent fd46805 commit eed7066

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

app/src/processing/app/ui/Editor.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,19 @@ protected void buildMenuBar() {
633633
base.populateToolsMenu(toolsMenu);
634634
menubar.add(toolsMenu);
635635

636-
menubar.add(buildHelpMenu());
636+
JMenu helpMenu = buildHelpMenu();
637+
if (Platform.isMacOS()) {
638+
// There's a bug on macOS since at least 2016 that leaves the
639+
// Help menu disabled after a modal dialog has been shown.
640+
// In 2018, it was closed by Oracle with a claim that it couldn't
641+
// be reproduced: https://bugs.openjdk.org/browse/JDK-8196655
642+
// The workaround is to add a space to the end of the menu name,
643+
// which disables whatever macOS behavior is causing the problem.
644+
// https://github.com/processing/processing4/issues/638
645+
helpMenu.setText(helpMenu.getText() + " ");
646+
}
647+
menubar.add(helpMenu);
648+
637649
Toolkit.setMenuMnemonics(menubar);
638650
setJMenuBar(menubar);
639651
}

todo.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
1290 (4.1.2?)
2-
2+
X Help Menu disabled on OS X (looks like a JVM bug)
3+
X https://github.com/processing/processing/issues/4353#issuecomment-237715947
4+
X https://github.com/processing/processing4/issues/617
35

46
contributed
57
X “Cannot find a class or type named ‘PApplet’” error
@@ -825,9 +827,6 @@ _ https://github.com/processing/processing4/issues/234
825827
_ we're not posting any, can we suppress the "allow notifications" message?
826828
_ https://developer.apple.com/documentation/usernotifications
827829
_ https://developer.apple.com/documentation/usernotifications/asking_permission_to_use_notifications
828-
_ Help Menu disabled on OS X (looks like a JVM bug)
829-
_ https://github.com/processing/processing/issues/4353#issuecomment-237715947
830-
_ still broken in 11.0.8
831830
_ Java bug prevents us from setting the dock name of a sketch run from the PDE
832831
_ https://github.com/processing/processing/issues/5045
833832
_ client properties

0 commit comments

Comments
 (0)