[Lazarus] Linux Window Handles

Graeme Geldenhuys graemeg.lists at gmail.com
Sun Aug 3 09:53:06 CEST 2008


On Sun, Aug 3, 2008 at 6:37 AM, SteveG <steveg at nevets.com.au> wrote:
> Having a problem understanding the usage of window handles in Linux
>
> Linux (Ubuntu 8.04):
> I can find no correlation between the Laz supplied window handle
> (Form1.Handle), and the X11 required handle - found using 'xwininfo -int
> -tree' (and clicking on Form1 of testapp)
> As an example, Laz returned 138531872, xwininfo returned 62915166.

I think the following is true, but I might be wrong. Due to the fact
that LCL doesn't talk directly to XLib (unlike fpGUI), it returns some
GTK object handle. I guess you need to find a way to convert or query
the actual X11 handle from that GTK object handle. This is just a
guess.

> As an aside to this, how do I determine the 'main/important' window
> handle from the list returned by

I simply use "xwininfo -tree" and gives me the following results,
after I clicked on the window I am interested in.

----------------------[ start ]------------------------------
graemeg at graemeg-laptop:~$ xwininfo -tree

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x2e000a4 "Vodafone Mobile Connect Card driver for Linux"

  Root window id: 0x5b (the root window) (has no name)
  Parent window id: 0x100013d (has no name)
     25 children:
     0x2e000fd (has no name): ()  578x15+2+468  +1305+1150
     0x2e000fc (has no name): ()  15x3+583+462  +1886+1144
     0x2e000f5 (has no name): ()  576x1+3+463  +1306+1145
        1 child:
        0x2e000f6 (has no name): ()  566x1+5+5  +1311+1150
           1 child:
           0x2e000f7 (has no name): ()  566x1+0+0  +1311+1150
     0x2e000f4 (has no name): ()  600x27+0+433  +1303+1115
     0x2e000f3 (has no name): ()  168x87+416+307  +1719+989
     0x2e000d8 (has no name): ()  168x87+242+307  +1545+989
<...snip....>
------------[  end  ]-----------------

Now that clearly shows the root id (desktop or Root window id: 0x5b)
and the main window I clicked on (Parent window id: 0x100013d) and
then it's 25 children with their positions.


Regards,
 - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list