Slowpoke101 / FTBLaunch

Launcher for the FTB Mod Pack
182 stars 140 forks source link

System-Tray Icon issue on Linux - XFCE #879

Closed cheerleone closed 10 years ago

cheerleone commented 10 years ago

Missing call to isSupported() possibly causes the bug below. http://docs.oracle.com/javase/7/docs/api/java/awt/SystemTray.html

The net result is that a phantom icon is permanently displayed on in the main view screen - top left, below system tray/menu. The 'icon' contains whatever was there at the time the bug occurred. And cannot be cleared without either forcefully restarting the display server, disabling/enabling a compositor or waiting until the actual minecraft client is closed.

Notes: This bug occurs ~50% of the time. The system tray is available and other applications are able to insert icons into it without issue. Calling the function listed above would result in the icon being displayed 50% of the time, indicating this could be an upstream bug in Java. An additional workaround for us fringe cases with XFCE may be to have an advanced launcher option to disable the system tray functionality completely.

image of issue: http://i.imgur.com/V5kQFrq.png

[03:41:58] [ERROR] SystemTray.getSystemTray:186->LaunchFrame$1$2.uncaughtException:366: Unhandled exception in Thread[AWT-EventQueue-0,6,main]: java.lang.UnsupportedOperationException: The system tray is not supported on the current platform. java.awt.SystemTray.getSystemTray(SystemTray.java:186) sun.awt.X11.XTrayIconPeer$4$1.run(XTrayIconPeer.java:211) java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312) java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) java.awt.EventQueue.access$200(EventQueue.java:103) java.awt.EventQueue$3.run(EventQueue.java:694) java.awt.EventQueue$3.run(EventQueue.java:692) java.security.AccessController.doPrivileged(Native Method) java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) java.awt.EventQueue$4.run(EventQueue.java:708) java.awt.EventQueue$4.run(EventQueue.java:706) java.security.AccessController.doPrivileged(Native Method) java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) java.awt.EventQueue.dispatchEvent(EventQueue.java:705) java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

progwml6 commented 10 years ago

we call isSupported here https://github.com/Slowpoke101/FTBLaunch/blob/master/src/main/java/net/ftb/main/Main.java#L326 there is a command line option to disable the tray for these cases -t

cheerleone commented 10 years ago

thanks