diff --git a/src/x11_init.c b/src/x11_init.c index 0bd38485..8b7c7204 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -719,7 +719,18 @@ int _glfwPlatformInit(void) _glfw.x11.display = XOpenDisplay(NULL); if (!_glfw.x11.display) { - _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to open X display"); + const char* display = getenv("DISPLAY"); + if (display) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "X11: Failed to open display %s", display); + } + else + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "X11: The DISPLAY environment variable is missing"); + } + return GL_FALSE; }