How does one identify which process is behind a certain tool bar icon without having to rely on asking someone on the know or just killing processes until the icon in question magically disappears? For X11 there are tools like
xwininfo. Is there anything similar for (older) OS X versions like Mavericks?
An example case: How to figure which process (by process ID) has produced the highlighted icon on my toolbar? I'm happy to do some programming if necessary, but would rather not reinvent the wheel here.
A partial solution to this problem would be to use Accessibility Inspector, as described on one of answers. However, quite often it does not reveal enough information (nor does it allow one to go get all the way to the process ID without some manual labor on the way).
For example, for the icon above Accessibility Inspector is not much of help: