Added X error reporting to window creation failure.

This commit is contained in:
Camilla Berglund 2013-11-10 14:12:07 +01:00
parent bc625b21b3
commit 76afd41727

View File

@ -136,6 +136,8 @@ static GLboolean createWindow(_GLFWwindow* window,
wamask |= CWBackPixel; wamask |= CWBackPixel;
} }
_glfwGrabXErrorHandler();
window->x11.handle = XCreateWindow(_glfw.x11.display, window->x11.handle = XCreateWindow(_glfw.x11.display,
_glfw.x11.root, _glfw.x11.root,
0, 0, 0, 0,
@ -147,12 +149,12 @@ static GLboolean createWindow(_GLFWwindow* window,
wamask, wamask,
&wa); &wa);
_glfwReleaseXErrorHandler();
if (!window->x11.handle) if (!window->x11.handle)
{ {
// TODO: Handle all the various error codes here and translate them _glfwInputXError(GLFW_PLATFORM_ERROR,
// to GLFW errors "X11: Failed to create window");
_glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to create window");
return GL_FALSE; return GL_FALSE;
} }