Is there any package which shows PID of a window by clicking on it?
Getting a window's PID by clicking on it
xorg;process management
Yes. Try xprop and you are looking for the value of _NET_WM_PID:xprop _NET_WM_PID | cut -d' ' -f3{click on window}