Skip to content

Commit a2b5f66

Browse files
committed
Fix macOS 10.13 missing menubar
The global bar is being used if locale is English and About() menu is present
1 parent 7c27d09 commit a2b5f66

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/src/processing/app/Base.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ static public void main(String args[]) throws Exception {
133133
System.setProperty("java.net.useSystemProxies", "true");
134134

135135
if (OSUtils.isMacOS()) {
136+
System.setProperty("apple.laf.useScreenMenuBar",
137+
String.valueOf(!System.getProperty("os.version").startsWith("10.13")
138+
|| com.apple.eawt.Application.getApplication().isAboutMenuItemPresent()));
139+
136140
ThinkDifferent.init();
137141
}
138142

app/src/processing/app/Editor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ public void actionPerformed(ActionEvent e) {
619619
fileMenu.add(item);
620620

621621
// macosx already has its own preferences and quit menu
622-
if (!OSUtils.isMacOS()) {
622+
if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") {
623623
fileMenu.addSeparator();
624624

625625
item = newJMenuItem(tr("Preferences"), ',');
@@ -1252,7 +1252,7 @@ public void actionPerformed(ActionEvent e) {
12521252
menu.add(item);
12531253

12541254
// macosx already has its own about menu
1255-
if (!OSUtils.isMacOS()) {
1255+
if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") {
12561256
menu.addSeparator();
12571257
item = new JMenuItem(tr("About Arduino"));
12581258
item.addActionListener(new ActionListener() {
@@ -1812,7 +1812,7 @@ protected boolean checkModified() {
18121812
String prompt = I18n.format(tr("Save changes to \"{0}\"? "),
18131813
sketch.getName());
18141814

1815-
if (!OSUtils.isMacOS()) {
1815+
if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") {
18161816
int result =
18171817
JOptionPane.showConfirmDialog(this, prompt, tr("Close"),
18181818
JOptionPane.YES_NO_CANCEL_OPTION,

arduino-core/src/processing/app/macosx/Platform.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ public Platform() {
6262
@Override
6363
public void init() throws Exception {
6464
super.init();
65-
66-
System.setProperty("apple.laf.useScreenMenuBar", "true");
67-
6865
discoverRealOsArch();
6966
}
7067

0 commit comments

Comments
 (0)