GNOME Bugzilla – Bug 105101
Cross-platform "tray icon" API
Last modified: 2011-02-04 16:10:23 UTC
The Windows API for notification area icons is pretty opaque, and also quite similar to our GNOME/KDE tray icon spec, so we should be able to write a cross-platform thing in GDK. Issues: - on Windows, I believe it has to be just an icon, not a window - on Windows, you can get a couple random events on the icon like button press - if we don't make it a GdkWindow, how do we represent getting a button press so you can do the right-click menu? Perhaps just make the GObject have popup_menu and clicked signals, and handle the button press with private/internal API, and apps are limited to handling only left click and providing a menu, nothing fancier. - it is a bit lowest-common-denominator to limit people to no GdkWindow in the tray since they could do that on X11, but perhaps it's good for UI consistency anyhow to be sure the icon is always only an icon, and always has a menu on right click and some action on left click.
parking on 'future' milestone for the moment.
I think it would be good anyway to have a popup_menu-signal rather than button-clicked since that way all icons would popu p the menu on the same action, rather than what the author felt was a good button to popup menu.
I got dragged in by Jeff to work on this (:. Aiming for 2.4, putting myself on CC. Hope to have something ready soonish.
<@hp> kris: I would basically agree that the API should have a "popup menu" and "clicked" signals instead of raw mouse events <@hp> kris: otherwise it won't be abstract enough
The EggStatusIcon seems to be a pretty good approximation to the API that can be supported cross-platform (after looking what Java, SWT and wxWidgets offer).
2005-08-29 Matthias Clasen <mclasen@redhat.com> Add a cross-platform "tray icon" API, by porting EggStatusIcon/EggTrayIcon (#105101) * gtk/gtkstatusicon.h: A GtkStatusIcon is an object which displays an icon in a notification area. * gtk/gtkstatusicon-x11.c: GtkStatusIcon implementation for X11, using GtkTrayIcon. * gtk/gtktrayicon.h: * gtk/gtktrayicon.c: An implementation of the freedesktop.org system tray specification, not public API. * gtk/gtk.symbols: Add new exported functions. * gtk/gtk.h: Include gtkstatusicon.h. * gtk/Makefile.am: Add new files. * tests/Makefile.am: * tests/teststatusicon.c: Test for GtkStatusIcon.