forked from dorkbox/SystemTray
Added ChromeOS to detection. It does not work as there are no libraries
supporting it, and Swing cannot create a native peer via X11.
This commit is contained in:
parent
ec0f4c911c
commit
210e423b5f
@ -57,6 +57,8 @@ OS | Supported
|
|||||||
--- | --- |
|
--- | --- |
|
||||||
Arch Linux + Gnome3 | ✓ |
|
Arch Linux + Gnome3 | ✓ |
|
||||||
| |
|
| |
|
||||||
|
ChromeOS | - |
|
||||||
|
| |
|
||||||
Debian 8.5 + Gnome3 | ✓ |
|
Debian 8.5 + Gnome3 | ✓ |
|
||||||
Debian 8.6 + Gnome3 | ✓ |
|
Debian 8.6 + Gnome3 | ✓ |
|
||||||
| |
|
| |
|
||||||
|
@ -328,6 +328,12 @@ class SystemTray {
|
|||||||
// With eOS, we CANNOT show the spacer image. It does not work.
|
// With eOS, we CANNOT show the spacer image. It does not work.
|
||||||
return selectTypeQuietly(TrayType.AppIndicator);
|
return selectTypeQuietly(TrayType.AppIndicator);
|
||||||
}
|
}
|
||||||
|
case ChromeOS:
|
||||||
|
// ChromeOS cannot use the swing tray (ChromeOS is not supported!), nor AppIndicaitor/GtkStatusIcon, as those
|
||||||
|
// libraries do not exist on ChromeOS. Additionally, Java cannot load external libraries unless they are in /bin,
|
||||||
|
// BECAUSE of the `noexec` bit set. If JNA is moved into /bin, and the JNA library is specified to load from that
|
||||||
|
// location, we can use JNA.
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to autodetect if we can use app indicators (or if we need to fallback to GTK indicators)
|
// Try to autodetect if we can use app indicators (or if we need to fallback to GTK indicators)
|
||||||
@ -687,6 +693,14 @@ class SystemTray {
|
|||||||
trayType = selectTypeQuietly(SystemTray.FORCE_TRAY_TYPE);
|
trayType = selectTypeQuietly(SystemTray.FORCE_TRAY_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trayType == null && OSUtil.DesktopEnv.isChromeOS()) {
|
||||||
|
logger.error("ChromeOS detected and it is not supported. Aborting.");
|
||||||
|
|
||||||
|
systemTrayMenu = null;
|
||||||
|
systemTray = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// fix various incompatibilities with selected tray types
|
// fix various incompatibilities with selected tray types
|
||||||
if (isNix) {
|
if (isNix) {
|
||||||
@ -765,7 +779,7 @@ class SystemTray {
|
|||||||
// at this point, the tray type is what it should be. If there are failures or special cases, all types will fall back to
|
// at this point, the tray type is what it should be. If there are failures or special cases, all types will fall back to
|
||||||
// Swing.
|
// Swing.
|
||||||
|
|
||||||
if (isNix) {
|
if (isNix && !isTrayType(trayType, TrayType.Swing)) {
|
||||||
// linux/unix need access to GTK, so load it up before the tray is loaded!
|
// linux/unix need access to GTK, so load it up before the tray is loaded!
|
||||||
GtkEventDispatch.startGui(FORCE_GTK2, PREFER_GTK3, DEBUG);
|
GtkEventDispatch.startGui(FORCE_GTK2, PREFER_GTK3, DEBUG);
|
||||||
GtkEventDispatch.waitForEventsToComplete();
|
GtkEventDispatch.waitForEventsToComplete();
|
||||||
|
Loading…
Reference in New Issue
Block a user