I was looking for a way to get the location of the active window on my screen when I stumbled upon a post in SO that had the code for me, but I got stuck trying to figure out what it did. The xlibs docs (for python) doesn't seem very helpful either. Going through https://tronche.com/gui/x/xlib-tutorial, it provides a link to https://tronche.com/gui/x/xlib-tutorial/screen-and-root-window.html which, based on the URL, looks like what I'm looking for but sadly it gives me a "Page Not Found".
So, what does "The screen root window" refer to? Also, is there a better place I can look for xlib resources?
X window system organizes its display into a hierarchy of windows.
By default, X creates one window the size of a physical screen. This is called the "root window" and its purpose is typically to provide a default background in cases when there is nothing else covering that part of the screen. When root window is empty, X will (at least in the older versions) display a white-black checkerboard pattern.
In most graphical environments the root window is typically used for desktop background or for screen savers. When rendering the output, the X first paints the root window into a framebuffer, followed by all the nested elements. The nested elements are the "normal" windows - they are painted over the parent by covering parts of it, which is what in the end gives you the impression of "windows on a background".