From c96da7905809e09db00f83925e84907ef14b58b1 Mon Sep 17 00:00:00 2001 From: Syer10 Date: Sat, 5 Jun 2021 14:06:36 -0400 Subject: [PATCH] Fix MacOS crashing on launch (#132) --- .../main/kotlin/suwayomi/tachidesk/server/util/SystemTray.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/util/SystemTray.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/util/SystemTray.kt index 3fc347c..774c937 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/util/SystemTray.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/util/SystemTray.kt @@ -24,6 +24,10 @@ object SystemTray { CacheUtil.clear(BuildConfig.NAME) + if (System.getProperty("os.name").startsWith("Mac")) { + SystemTray.FORCE_TRAY_TYPE = SystemTray.TrayType.Awt + } + val systemTray = SystemTray.get(BuildConfig.NAME) ?: return null val mainMenu = systemTray.menu