Re: ./teststatusicon (was Re: A cross-platform status icon api)



On Sun, 2005-09-18 at 14:27 +0200, Hans Breuer wrote:
> On 06.09.2005 15:08, Matthias Clasen wrote:
> > On Mon, 2005-09-05 at 23:25 +0200, Hans Breuer wrote:
> [...]
> >>Also gtkstatusicon-x11.c not only implements the fdo spec but it also
> >>defines a bunch of status icon api. Not only 21 functions but additionally
> >>quite some properties. Should all this be duplicated to get the
> >>cross-platform status api ?
> > 
> > 
> > Hmm, good point. When I did that code I thought a clean separation
> > between the X and win32 implementations would be better, but looking at
> > the code in gtkstatusicon-x11.c, only a few lines deal with the tray
> > icon. Do you think it would be feasible to #ifdef out the
> > platform-specifc parts without too much pain ? If so, then we should
> > probably do the cvs surgery to rename gtktrayicon.c to gtktrayicon-x11.c
> > and gtkstatusicon-x11.c gtkstatusicon.c.
> > 
> Before diving too deep into the code of (now) gtkstatusicon.c I've tried
> it on Linux - but it does not work there, too. What am I supposed to
> update so see any effect of ./teststatusicon ? (I'm running gnome-2.10.2
> on gentoo with xorg-x11-6.8.2)

Works fine for me. If I run teststatusicon, a blinking icon shows up in
the system tray in my panel. You have a system tray on your panel,
right ?

> I've just checked in a dummy implementation for gtktrayicon-win32.c to
> make gtk+-2.9 compile again. To make a working implementation for win32
> the missing pieces are :
> 
> - get rid of the GtkPlug inheritance - maybe even in gtktrayicon.h ?
> - convert the icon/pixbuf to a HICON. There is code to do that in
>    _gdk_win32_pixbuf_to_hicon()
> - define a gtk signal to be emitted when the user clicks on the trayicon
> - ...


Still wrong, IMO. the GtkTrayIcon is a detail of the X11 statusicon
implementation. It is specific to the freedesktop system tray
specification, which builds on the XEmbed spec. Therefore it is most
logical to derive it from GtkPlug.

On Win32, you should just implement the GtkStatusIcon API, which does
have the activate and popup_menu signals you are supposed to emit
when the icon is clicked, btw.

Matthias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]