From bdf76e13fd58f6f0ae99325de0f144e0ba544b83 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 5 Oct 2016 11:58:33 +0200 Subject: [PATCH] Added extra configuration checks when running windows/mac for unsupported tray types. --- src/dorkbox/systemTray/SystemTray.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dorkbox/systemTray/SystemTray.java b/src/dorkbox/systemTray/SystemTray.java index bb29cc3..2251ad5 100644 --- a/src/dorkbox/systemTray/SystemTray.java +++ b/src/dorkbox/systemTray/SystemTray.java @@ -173,6 +173,14 @@ class SystemTray extends Menu { if (DEBUG) { logger.debug("is JavaFX detected? {}", isJavaFxLoaded); logger.debug("is SWT detected? {}", isSwtLoaded); + } else { + // windows and mac ONLY support the Swing SystemTray. + // Linux CAN support Swing SystemTray, but it looks like crap (so we wrote our own GtkStatusIcon/AppIndicator) + if (OS.isWindows() && FORCE_TRAY_TYPE != TYPE_SWING) { + throw new RuntimeException("Windows is incompatible with the specified option for FORCE_TRAY_TYPE: " + FORCE_TRAY_TYPE); + } else if (OS.isMacOsX() && FORCE_TRAY_TYPE != TYPE_SWING) { + throw new RuntimeException("MacOSx is incompatible with the specified option for FORCE_TRAY_TYPE: " + FORCE_TRAY_TYPE); + } } // kablooie if SWT is not configured in a way that works with us.