Hi,

I just checked what is currently in lazarus svn, and there you do:

  GTK_WIDGET_SET_FLAGS(PGtkWidget(GtkForm.Handle),GTK_VISIBLE);
  GTK_WIDGET_SET_FLAGS(PGtkWidget(GtkForm.Handle),GTK_MAPPED);

in TWidgetTrayIcon.Show. 

(wsgtk2trayicon).

Don't do that! SET_FLAGS is mostly for gtk internal use. Nobody should
ever need to call that :)

What you mean to use is probably GtkForm.Show (or gtk_widget_show, used
by GtkForm.Show).

If you set it like that, it thinks it is already visible (mapped) and
doesn't bother doing it for real :)

Don't do the Sleep(80) either (what the heck ... If that causes any
problems without, fix the root problem instead ;))

(btw: is your version more up-to-date than what is currently in svn? -
i.e. do I review old code? :))

cheers,
   Danny


Am Dienstag, den 31.01.2006, 09:30 -0200 schrieb Felipe Monteiro de
Carvalho:
> I added gdk2x unit to wsgtk2trayicon file, so now the Gtk2 file is 
> exactly like Gtk1 file, except for the uses clause.
> 
> Specifically the following lines are now just like Gtk1 file:
> 
> procedure TWidgetTrayIcon.CreateForm(id: Integer);
> begin
> .....
>    fDisplay := 
> GDK_WINDOW_XDISPLAY(Pointer(PGtkWidget(GtkForm.Handle)^.window));
> //  SHowMessage(IntToStr(Integer(fDisplay)));
>    fWindow := GDK_WINDOW_XWINDOW 
> (Pointer(PGtkWidget(GtkForm.Handle)^.window));
>    fScreen := XDefaultScreenOfDisplay(fDisplay); // get the screen
>    fScreenID := XScreenNumberOfScreen(fScreen); // and it's number
> end;
> 
> Yet, the exact same problem occurs.
> 
> So, can I suppose that the problem is not related to the above lines??
> 
> > Is space for the icon allocated in the tray - i.e. is there a "hole"  ?
> 
> Yes, space for the icon is allocated in the tray, but it is fully grey. 
> I know that this is my window, because the grey on the background of 
> lazarus programs is sligtly different from the gray on KDE taskbar.
> 
> > - and it just doesnt draw or doesn't "anything" happen? In your version,
> > check the value of fWindow and use "xwininfo -id xxxxx" to see if it's
> > correct...
> 
> It doesn't draw the icon and it doesn't respond to events, like OnClick.
> 
> > Most of those kind of problems with lowlevel X stuff not getting
> > executed properly have to do with the widget not being realized yet...
> > Might want to make double-sure that it is :)
> 
> How can I check if the widget is being realized??
> 
> thanks,
> 
> Felipe
> 
> _________________________________________________________________
>      To unsubscribe: mail [EMAIL PROTECTED] with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives
> 

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to