On Mon, 13 Jan 2003 16:43:14 +0100 (CET) Krasi Zlatev <[EMAIL PROTECTED]>
babbled:

> I would like to gather inforamtion about all the
> running X applicaiotns.
> Thus I do
> Window root = RootWindow (dpy, screenno);
> XQueryTree (dpy, root, &dummywindow, &dummywindow,
> &children, &nchildren);
> 
> for (i = 0; i < nchildren; i++) {
>         if (XGetWindowAttributes(dpy, children[i],
> &attr) && (attr.map_state == IsViewable)) {
> XFetchName(dpy, children[i], &win_name);
> printf("Window ID: 0x%lx\n",children[i]);
> }
> }
> 
> I thought that win_name will contain the name of the
> window, but it is always null,
> what am I doing wrong?

short answer and you'll figure it out yourself:

xwininfo -tree -root
:)

long answer:
x loves windows. it isnt single level like mac os (a root and then windows).
it's a big big big VEEEERY deep tree. client window will be 2 or 3, maybe 4
levels down (this may vary depending on how deep your wm likes to reparent
client windows within its scheme of things).

you need to keep traversing the tree down as far as you can go (ALL the way...
do NOT just stop at the first window with a title... it IS possible that client
windows can be managed within other client windows... ie MDI style). :)

-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]
                                    [EMAIL PROTECTED]
Mobile Phone: +61 (0)413 451 899    Home Phone: 02 9698 8615
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to