Description of problem: Java provides classes for application who'd like to use tray icon functionality available in many desktop environments. Gnome Shell doesn't have traditional system tray facility and so it doesn't support tray icons directly. However, it does have some alternative mechanisms (Looks like that there is something as notification persistence which can be used to implement almost the same functionality [1]). It would be great if tray icon facility is emulated using these mechanisms for better Java application compatibility. In the worst case, gnome shell should be probably marked as an environment without support for tray icons, so at least the application will know that it cannot use its tray icon. Thanks [1] http://live.gnome.org/GnomeShell/Design/Guidelines/MessageTray/Compatibility Version-Release number of selected component (if applicable):
Notice: AFAIK even gnome 3's fallback mode needs such support.
Thanks for filing the bug. I will take a look at this. (In reply to comment #0) > In the worst case, > gnome shell should be probably marked as an environment without support for > tray icons, so at least the application will know that it cannot use its tray > icon. Isn't this bit already working? Java (at least a recent enough version of java-1.6.0-openjdk) implements the System Tray Protocol Specification [1] to find a system tray. If Gnome shell does not provide a system tray, openjdk should figure this out automatically. [1] http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html
Thanks for considering this issue :) First, I was wrong, the tray icon works in fallback mode. About the other: well, looks like that Gnome Shell provides some kind of support for system tray protocol; however it seems that it is implemented in a special way. While some applications can correctly use it, the tray icon of Java applications doesn't work correctly in Gnome Shell and you'll see that a very small window is available among application windows. But that small window is completely useless. If it works fine, the tray icon should be added to the bottom bar of gnome shell (which is visible when mouse pointer is on the bottom of screen).
Ugh. From reading the gnome-shell documentation, I gather that they have dropped support for the system tray (in general). The do have a new-ish (but rather incompatible) API for what they call Notifications and Messaging Tray [1], but it doesnt look like it will support Java's entire SystemTray API [2] (especially popup menus). [1] http://live.gnome.org/GnomeShell/Design/#Notifications_and_messaging_tray [2] http://download.oracle.com/javase/6/docs/api/java/awt/TrayIcon.html
Well, I'm not very informative in this regard. However, I can observe that some applications do have popup menus in Gnome Shell too. For example, IBUS does have an icon in the bottom pane which (the icon itself, not the text beside it) has both right click and left click popup menus. Pidgin is another example which works fine there.
If there's something that can be fixed at the actual native system tray level, then I guess something can be done when distros actually start using this thing. But that API is a standard 1.6 Java API so it can't change. As Gnome 3 is the one changing things here, I think the onus is on it and not every individual application to work with the existing system tray standard.
Since there are programs which works correctly even without doing any special changes for Gnome Shell, it seems that it can be fixed in the Java implementation. And certainly I'm not asking for changing Java API. It looks more like bug fixing the implementation rather than undergoing a subtle change. BTW, consulting with Gnome Shell guys might be needed for clarification.
Java SE 6 Update 25 has not solve the problem...
Hello! I'm currently developing a small Java application, which use the SystemTray (Notification-Area). That works quite well with Gnome2, like written above that is a problem with Gnome3. I'm doing this during creation of the TrayIcon: ----------------------------------------------------------------------------- // create systray if (!SystemTray.isSupported()) { System.err.println("Systray unuseable."); System.exit(11); // return 11 means no Systray } ----------------------------------------------------------------------------- Java thinks everything is all right and doesn't close the application. But I doesn't get a entry for my application in the message-tray at the bottom of the screen. Other older application (not written in Java) seem to work out-of-the-box "somewhat" with message-tray. I know that the NotificationArea(SystemTray) is - deprecated: https://live.gnome.org/GnomeShell/Design/Guidelines/MessageTray http://ploum.net/post/219-the-aristocratic-desktop-part-3-there-s-no-tray-icon-in-gnome If there is a way to use the MessageTray in a correct and nice manner, I would appreciate it :-)
Gnome-shell developers believe that the tray icon implementation on Java is probably broken in some way, but they need more info about the implementation. See https://bugzilla.gnome.org/show_bug.cgi?id=648773
More specifically, not only does gnome-shell implement the systray protocol, it actually uses the same code as gnome-panel does in fallback mode. (The na-tray-manager.c and na-tray-child.c code from gnome-panel is cut+pasted into the gnome-shell source tree.) So it seems like the problem must be that the java tray client code is making some additional incorrect check and then deciding to not use the systray even though it's there.
Update from the GNOME bug; the problem is that gnome-shell expects trayicons to set _NET_WM_PID on their window, and it messes things up if they don't. This will eventually be fixed in gnome-shell, but it's probably an easy fix on the java side to just set that property.
Looking into this; both _NET_WM_PID and WM_CLIENT_MACHINE need to be set: http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html#id2523510
Any updates on the Java side?! It seems that the bug is very easy to fix, so....?!
(In reply to comment #14) > Any updates on the Java side?! It seems that the bug is very easy to fix, > so....?! I just sent a review request to openjdk: http://mail.openjdk.java.net/pipermail/awt-dev/2011-October/001951.html Stay tuned..
Thanks.
This was pushed to upstream openjdk8[1] some days ago. I've also just pushed it into icedtea6 HEAD[2]. I'll ask for it to be backported to openjdk6 and 7 and will be backporting this to icedtea7 shortly. [1] http://hg.openjdk.java.net/jdk8/awt/jdk/rev/f614bcada2a9 [2] http://icedtea.classpath.org/hg/icedtea6/rev/15d88aeb3dc4
Thanks. Hope to see it in the repos soon.
Progress?
(In reply to comment #19) > Progress? This was pushed to jdk7u-dev back in November[1] and I have just made a review request for icedtea7-forest and icedtea7-forest-2.0[2]. I'll close this report once it's pushed to the release forest (since rawhide will be using it then). [1] http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/f1d09dc7f9a7 [2] http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-January/016991.html
This is fixed in 1.11 which should be making its way to the Fedora's which still carry 1.6 (F14 and F15) soon, if it hasn't already. The 7 update should appear with the next security update in a couple of weeks.
http://blog.fuseyism.com/index.php/2012/01/31/icedtea6-1-11-released/
Finally, the updated landed in Fedora 16 for openjdk 6, and it works almost fine. The icon appears in the message tray actually, so this bug can be considered closed for OpenJDK 6 (OpenJDK 7's update is not arrived yet for Fedora 16 AFAIK). However, there is still a very small window shown in Gnome's Alt+Tab list (sometimes in overview mode too, sometimes not!). It would be great if that small window is also omitted. Thanks :)
> However, there is still a very small window shown in Gnome's Alt+Tab list > (sometimes in overview mode too, sometimes not!). It would be great if that > small window is also omitted. We discussed this somewhat in the email thread I posted earlier[1] and decided this was a separate issue. I believe it has to do with the order of the tuple WM_CLASS not being set correctly. I'll tackle it when I get the chance. > Thanks :) You're welcome, thanks for reporting! =) This is now in rawhide[2] and icedtea7-forest[3], closing this bug. [1] http://mail.openjdk.java.net/pipermail/awt-dev/2011-November/001999.html [2] http://icedtea.classpath.org/hg/release/icedtea7-forest-2.0/jdk/rev/c705a1cdc132 [3] http://icedtea.classpath.org/hg/icedtea7-forest/jdk/rev/afdcedc27c23