X Windows at least has the "advantage" that you can download the code for Xlib or the Xorg server itself to see what's going on under the hood.
Although, you're going to have to be fairly proficient to get your head around that stuff too.
Agree that X11 has a dreadful API.