get process pid from xwindow id with Gnome2::Wnck



Hi,

I'm trying to work out a scheme, of being able to click on an xwindow,
and get the pid of the process.

My first thoughts were to try and use Gnome2::Wnck.

It has a method  $window->get_pid, but the tricky part is
getting the window identified by clicking it with a mouse.

Before I start banging my head on the table, does anyone
have a clue as to how to do this?

I'm assuming you need to do a Gtk2::Gdk->pointer_grab( ) on the root window, 
and watch the button press event. But how can I tell which window, if any,
the button-press was done in?  
What I'm looking for is a pure perl way to get the X window id, like xwininfo does.
Any clues?

Thanks,
zentara

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]