Re: XForms: How to swallow X clients and XForms menu suggestion.

Steve Lamont (spl@szechuan.ucsd.edu)
Sat, 22 Nov 97 20:58:59 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I believe you basically call XReparentWindow() with the window ID
> of the X client you are trying to swallow and the window ID of an XForms
> canvas object as the new parent to get an XForms program to swallow
> another X client. Am I right on this? However, assuming this is correct,
> my problem is obtaining the window ID of the X client I am trying to
> swallow. I figured on using XQueryTree() to get a list of all child
> windows of the root window, then use XFetchName() on all the child windows
> returned by XQueryTree() to obtain a list of names of all the windows
> which have names. Then I can use this list of names to determine the
> window ID of the X client I want to swallow.

Bear in mind that the Windows have already been reparented by the
window manager, so that the top level windows may not be what you
think they are.

What you're going to see is the decoration around the actual Windows
rather than the Windows themselves. To find the actual Windows
belonging to the application, you'll have to recursively descend the
tree.

To get an idea of what you're looking for, try issuing the command

xwininfo -all | more

and click on the root window.

Here's a partial list of what I got on my box when I did it:

spl:spl> xwininfo -all

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

xwininfo: Window id: 0x2b (the root window) (has no name)

Root window id: 0x2b (the root window) (has no name)
Parent window id: 0x0 (none)
28 children:
0x1000c2f (has no name): () 579x894+571+4 +571+4
2 children:
0x340000d "szechuan:spl /home/spl": ("xterm" "XTerm") 579x875+0+19 +572+24
1 child:
0x3400014 (has no name): () 579x875+0+0 +572+24
1 child:
0x3400015 (has no name): () 14x875+-1+-1 +571+23
[...]
0x1000032 (has no name): () 200x192+952+100 +952+100
1 child:
0x1000031 "TWM Icon Manager": () 200x192+0+0 +953+101
8 children:
0x1000c8b (has no name): () 200x24+0+96 +953+197
1 child:
0x1000c8c (has no name): () 11x11+5+6 +958+203
[...]
0x1000035 (has no name): () 600x199+350+0 +350+0
2 children:
0x800009 "xconsole": ("xconsole" "XConsole") 600x180+0+19 +351+20
1 child:
0x80000a (has no name): () 600x180+0+0 +351+20
1 child:
[...]
0x100080f (has no name): () 578x888+570+8 +570+8
2 children:
0x2800012 "emacs@spl.extern.ucsd.edu": ("emacs" "Emacs") 578x868+0+20 +572+30
1 child:
0x2800013 (has no name): () 578x868+0+0 +572+30

... and a pile more junk ...

Anyhow, you need to go down at least one more level to find what
you're looking for.

As far as reparenting goes -- I'm not sure about how this would work,
never having tried it. I suspect you may end up confusing your window
manager if you're not careful.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/