Best guess merging most recent fixes from @rougier's PyGLFW.  Some fixes seem to have been applied in both separate versions.