Added extra configuration checks when running windows/mac for

unsupported tray types.
This commit is contained in:
nathan 2016-10-05 11:58:33 +02:00
parent 53ece33ac5
commit bdf76e13fd

View File

@ -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.