I want to recreate what DockBarX does but in Java. So I need to be able to query the top level windows in X11 (I can do that already) find the PID (got that too : _NET_WM_PID) but then map that to the application that created the window. I need to find which .desktop file (stored in /usr/share/applications) was launched that created the top-level window. But the pid is not really helpfull, often the pid could be a child process of another process which makes things complicated.
How does DockBarX do it? I'm trying to look thru source but my python knowledge is very limited.
Thanks.