(re: using _NET_WM_PID for pid => window lookups, as mentioned in IRC)
Turns out it's not so hard to get the window information using
X11::Protocol, so I've thrown out my initial C++ XS implementation in
favour of a separate module for doing pid/title window ID lookups:
http://metacpan.org/release/TEAM/X11-WindowHierarchy-0.002
Needs a few extra things such as geometry to be useful, but I'm
mentioning it here as an interim workaround (for X11 only,
unfortunately) until there's a cleaner solution.
cheers,
Tom