macOS fixes

This commit is contained in:
crschnick 2023-08-09 14:12:27 +00:00
parent 9932895ff5
commit 3b92f7d093
3 changed files with 7 additions and 2 deletions

View file

@ -13,6 +13,7 @@ import java.awt.*;
import java.lang.reflect.Field;
import java.time.Duration;
import java.time.Instant;
import java.util.Arrays;
public class AppTray {
@ -76,9 +77,13 @@ public class AppTray {
// Remove functionality to show stage when primary clicked and replace it with our own
SwingUtilities.invokeLater(() -> {
privateTrayIcon.removeActionListener(privateTrayIcon.getActionListeners()[0]);
for (var l : Arrays.stream(privateTrayIcon.getActionListeners()).toList()) {
privateTrayIcon.removeActionListener(l);
}
privateTrayIcon.addActionListener(e -> {
OperationMode.switchToAsync(OperationMode.GUI);
if (OsType.getLocal() != OsType.MACOS) {
OperationMode.switchToAsync(OperationMode.GUI);
}
});
});

View file

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

View file

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B