Fixed logic for AWT tray implelmentions
This commit is contained in:
parent
c6ade0a371
commit
01f3e0e90a
@ -594,7 +594,7 @@ class SystemTray implements Menu {
|
|||||||
// if it's linux + native menus must not start on the EDT!
|
// if it's linux + native menus must not start on the EDT!
|
||||||
// _AwtTray must be constructed on the EDT however...
|
// _AwtTray must be constructed on the EDT however...
|
||||||
if (isJavaFxLoaded || isSwtLoaded ||
|
if (isJavaFxLoaded || isSwtLoaded ||
|
||||||
(OS.isLinux() && NativeUI.class.isAssignableFrom(trayType) && trayType == _AwtTray.class)) {
|
(OS.isLinux() && NativeUI.class.isAssignableFrom(trayType) && trayType != _AwtTray.class)) {
|
||||||
try {
|
try {
|
||||||
reference.set((Menu) trayType.getConstructors()[0].newInstance(systemTray));
|
reference.set((Menu) trayType.getConstructors()[0].newInstance(systemTray));
|
||||||
logger.info("Successfully Loaded: {}", trayType.getSimpleName());
|
logger.info("Successfully Loaded: {}", trayType.getSimpleName());
|
||||||
@ -603,7 +603,6 @@ class SystemTray implements Menu {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// have to construct swing stuff inside the swing EDT
|
// have to construct swing stuff inside the swing EDT
|
||||||
// this is the safest way to do this.
|
|
||||||
final Class<? extends Menu> finalTrayType = trayType;
|
final Class<? extends Menu> finalTrayType = trayType;
|
||||||
SwingUtil.invokeAndWait(new Runnable() {
|
SwingUtil.invokeAndWait(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user