Fix macos quit not working

This commit is contained in:
crschnick 2023-11-29 19:25:32 +00:00
parent 68895cfb55
commit 700f539dfb

View file

@ -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);