diff --git a/app/src/main/java/io/xpipe/app/util/PlatformState.java b/app/src/main/java/io/xpipe/app/util/PlatformState.java index 866d923d..4acd3292 100644 --- a/app/src/main/java/io/xpipe/app/util/PlatformState.java +++ b/app/src/main/java/io/xpipe/app/util/PlatformState.java @@ -65,6 +65,16 @@ public enum PlatformState { return Optional.empty(); } + try { + // Weird fix to ensure that macOS quit operation works while in tray. + // Maybe related to https://bugs.openjdk.org/browse/JDK-8318129 as it prints the same error if not called + // The headless is not needed though but still done + GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); + } catch (HeadlessException e) { + TrackEvent.warn(e.getMessage()); + return Optional.of(e); + } + try { CountDownLatch latch = new CountDownLatch(1); Platform.setImplicitExit(false);