Pandora & X11 fixes

* OpenGL: Disable mipmap auto-generation on Pandora since it doesn't appear to work
* X11: Handle XI_HierarchyChanged before looking up window
* Various refactoring & build fixes