diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 9a91d68dd..6063ceb74 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -133,6 +133,10 @@ public class Base { System.setProperty("java.net.useSystemProxies", "true"); if (OSUtils.isMacOS()) { + System.setProperty("apple.laf.useScreenMenuBar", + String.valueOf(!System.getProperty("os.version").startsWith("10.13") + || com.apple.eawt.Application.getApplication().isAboutMenuItemPresent())); + ThinkDifferent.init(); } diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 71ecc5343..deb6870a9 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -619,7 +619,7 @@ public class Editor extends JFrame implements RunnerListener { fileMenu.add(item); // macosx already has its own preferences and quit menu - if (!OSUtils.isMacOS()) { + if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") { fileMenu.addSeparator(); item = newJMenuItem(tr("Preferences"), ','); @@ -1252,7 +1252,7 @@ public class Editor extends JFrame implements RunnerListener { menu.add(item); // macosx already has its own about menu - if (!OSUtils.isMacOS()) { + if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") { menu.addSeparator(); item = new JMenuItem(tr("About Arduino")); item.addActionListener(new ActionListener() { @@ -1812,7 +1812,7 @@ public class Editor extends JFrame implements RunnerListener { String prompt = I18n.format(tr("Save changes to \"{0}\"? "), sketch.getName()); - if (!OSUtils.isMacOS()) { + if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") { int result = JOptionPane.showConfirmDialog(this, prompt, tr("Close"), JOptionPane.YES_NO_CANCEL_OPTION, diff --git a/arduino-core/src/processing/app/macosx/Platform.java b/arduino-core/src/processing/app/macosx/Platform.java index 1bdce0128..68b3c96c5 100644 --- a/arduino-core/src/processing/app/macosx/Platform.java +++ b/arduino-core/src/processing/app/macosx/Platform.java @@ -62,9 +62,6 @@ public class Platform extends processing.app.Platform { @Override public void init() throws Exception { super.init(); - - System.setProperty("apple.laf.useScreenMenuBar", "true"); - discoverRealOsArch(); }