Hi,
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.
nice :)
>
> 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;
you should get rid of the defaultscreen thing somewhen, but as long as
you only have one screen on your machine, this shouldn't cause the
bug...
>
> 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.
Then it is realized (and probably mapped as well).
Try xwininfo and then click on it, or xev and see if it brags about
stuff it gets - like mouse clicks, ... (and check that it _is_ your
window, not the desktop's :)).
>
> > - 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.
gtk_widget_add_events(widget, GDK_BUTTON_PRESS_MASK); ?
>
> > 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??
>
To check if it is realized (useful only for debugging):
#define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) &
GTK_REALIZED) != 0)
To react on realize:
g_signal_connect 'realize' yourcallback_cb
when yourcallback_cb is called, it is realized.
After a window is realized, it has a xid (X window id).
Check that with GDK_WINDOW_XID and f.e. compare with xwininfo's idea of
what the id is of the empty area in the tray...
> thanks,
>
> Felipe
cheers,
Danny
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives