Hi, > >I need to be able to tell which process a given window > >was created by. (Window ID=>Process ID) > > > >Apparently, X servers don't know which process a > >client is, they just get a socket (b/c of X's network > >transparency). > > If you are running a window manager setting the _NET_WM_PID > property correctly (metacity does it, dunno about others) you can do the > mapping easily. The next example get that prop from the Window ID, and > then converts the PID to the UID of user running the process (it uses > libgtop for doing that):
I tried your example because I don't know the _NET_WM_PID property and was interested in it. Unfortunately the call to XGetWindowProperty() never filled the &prop data. Your code is checking against the return code of XGetWindowProperty() which is fine but prop equals to (nil) in all my tests. I was using metacity as suggested windowmanger. Do you have any idea why it fails ? The window Id which is required of course is obtained from a "xwininfo" call. I passed the information from this command to the example. Did I something stupid ? Thanks Regards Marcus -- Public Key available ---------------------------------------------------- Marcus Schäfer (Res. & Dev.) SUSE LINUX AG Tel: 0911-740 53 0 Maxfeldstrasse 5 FAX: 0911-741 77 55 D-90409 Nürnberg http://www.suse.de Germany ---------------------------------------------------- _______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel