mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 18:15:10 +00:00
Added X error reporting to window creation failure.
This commit is contained in:
parent
bc625b21b3
commit
76afd41727
@ -136,6 +136,8 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
wamask |= CWBackPixel;
|
||||
}
|
||||
|
||||
_glfwGrabXErrorHandler();
|
||||
|
||||
window->x11.handle = XCreateWindow(_glfw.x11.display,
|
||||
_glfw.x11.root,
|
||||
0, 0,
|
||||
@ -147,12 +149,12 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
wamask,
|
||||
&wa);
|
||||
|
||||
_glfwReleaseXErrorHandler();
|
||||
|
||||
if (!window->x11.handle)
|
||||
{
|
||||
// TODO: Handle all the various error codes here and translate them
|
||||
// to GLFW errors
|
||||
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to create window");
|
||||
_glfwInputXError(GLFW_PLATFORM_ERROR,
|
||||
"X11: Failed to create window");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user