user monitoring

Peter Hutterer mailinglists at who-t.net
Thu Jan 10 14:47:25 PST 2008


Redook wrote:
> Hello,
> 
> I need to write an application that would monitor which X applications 
> are used and what user is doing (if he's using mouse/keyboard with apps).
> My first idea was to monitor X events, I created a client that would 
> subscribe to events for all windows and somehow identify currently used 
> windows by Focus events. Unfortunately there's a problem with 
> identyfying the process that window belongs to (I used_NET_WM_PID 
> property but not every window has it). There's also probloem with 
> getting some events (i.e. button press) that I'm also interested in.
> 
> Now the question - is there any way to identify application having 
> widowid or other way to achieve what I'm trying to create? Maybe 
> modifying X source could give some better results, although I'd like to 
> stay away from that if possible.

no. the x server does not have knowledge of processes, only of client 
connections. you rely on the _NET_WM_PID, and this is voluntarily set by 
clients and may not reflect the correct pid.


Cheers,
   Peter



More information about the xorg mailing list