After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 105101 - Cross-platform "tray icon" API
Cross-platform "tray icon" API
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.2.x
Other other
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-02-03 05:24 UTC by Havoc Pennington
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2003-02-03 05:24:38 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.
Comment 1 Havoc Pennington 2003-02-03 05:25:04 UTC
parking on 'future' milestone for the moment.
Comment 2 Mikael Hallendal 2003-04-10 13:03:21 UTC
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.
Comment 3 Kristian Rietveld 2003-05-15 20:24:57 UTC
I got dragged in by Jeff to work on this (:. Aiming for 2.4, putting
myself on CC. Hope to have something ready soonish.
Comment 4 Kristian Rietveld 2003-05-15 21:00:10 UTC
<@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
Comment 5 Matthias Clasen 2005-08-18 03:01:48 UTC
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).
Comment 6 Matthias Clasen 2005-08-29 19:02:06 UTC
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.