[Gambas-user] Re: Window positions
Rob Kudla
sourceforge-raindog2 at ...94...
Tue Mar 21 21:38:46 CET 2006
On Tue March 21 2006 15:18, GuruLounge - MailLists wrote:
> So there's no way to do this?
You would either have to use gb.api with Xlib to iterate through
the list of X clients and retrieve the _NET_WM_PID property for
each, or shell out to some program that does it for you. I
haven't done this myself, just googled for a way to do it.
Don't forget, one process can have a lot of X window ID's (do
"xwininfo -root -tree -int" to see what I mean.) It's not
always safe to assume that the parent window is the main
application window.
Naturally, all this assumes that your Gambas app and the desired
window are on the same X display. Also, not all window managers
support _NET_WM_PID.... kwin has had it since KDE 3.1, but I
don't know if the more lightweight ones do.
This is the price of network transparency.... X servers were
never meant to know what process ID a window belonged to because
X was designed as a "many hosts, many terminals" protocol.
It's possible you could get the source of xtoolwait and modify it
to report back the X window ID as well as the process ID of the
tool it starts, but even that is kind of chancy.
Rob
More information about the User
mailing list