Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/processing/app/EditorToolbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.thizzer.jtouchbar.item.TouchBarItem;
import com.thizzer.jtouchbar.item.view.TouchBarButton;

import cc.arduino.contributions.VersionComparator;
import processing.app.helpers.OSUtils;

import java.awt.*;
Expand Down Expand Up @@ -149,7 +150,7 @@ public EditorToolbar(Editor editor, JMenu menu) {
statusFont = Theme.getFont("buttons.status.font");
statusColor = Theme.getColor("buttons.status.color");

if (OSUtils.isMacOS()) {
if (OSUtils.isMacOS() && VersionComparator.greaterThanOrEqual(OSUtils.version(), "10.12")) {
editor.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent e) {
if (touchBar == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public int compare(String a, String b) {
public static boolean greaterThan(String a, String b) {
return compareTo(a, b) > 0;
}

public static boolean greaterThanOrEqual(String a, String b) {
return compareTo(a, b) >= 0;
}

public static String max(String a, String b) {
return greaterThan(a, b) ? a : b;
Expand Down
4 changes: 4 additions & 0 deletions arduino-core/src/processing/app/helpers/OSUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ static public boolean isMacOS() {
static public boolean hasMacOSStyleMenus() {
return OSUtils.isMacOS() && "true".equals(System.getProperty("apple.laf.useScreenMenuBar"));
}

static public String version() {
return System.getProperty("os.version");
}
}