[clug] Xlib: map window to pid?

Hugh Fisher hugh.fisher at anu.edu.au
Mon Jul 14 02:18:26 GMT 2008

Dan Polk wrote:
> Hi,
> I have a question about Xlib, and would be very grateful to anyone who cared
> to share anything they might know about my question... Its work related, so,
> you know, bear that in mind before spending too long in reply ;)
> Specifically, I want to retrieve the process id (or name of the executable)
> which has created a given window (in practice, this will just be the active
> window, which I've obtained using XGetInputFocus()).
> I assume there is a way to map a window back to the process which created
> it, but I can't figure it.  Again, any help appreciated.  Or even where I
> could find a more appropriate list?

Window property _NET_WM_PID. Unofficial, but it's been
around for a while and works for GNOME/KDE.

	Hugh Fisher

More information about the linux mailing list