Binary package “libx11-windowhierarchy-perl” in ubuntu xenial

Perl module for retrieving the current X11 window hierarchy

 X11::WindowHierarchy provides a couple of helper functions based on
 X11::Protocol for extracting the current window hierarchy. You can easily get
 the whole window tree, or search for specific windows.