Handle case of no available CRTCs.

This commit is contained in:
Camilla Berglund
2014-01-22 17:24:00 +01:00
parent dd02b96c94
commit 5ed23e593c
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -43,10 +43,12 @@ void _glfwInitGammaRamp(void)
XRRScreenResources* rr = XRRGetScreenResources(_glfw.x11.display,
_glfw.x11.root);
if (XRRGetCrtcGammaSize(_glfw.x11.display, rr->crtcs[0]) == 0)
if (!rr->ncrtc || !XRRGetCrtcGammaSize(_glfw.x11.display, rr->crtcs[0]))
{
// This is probably older Nvidia RandR with broken gamma support
// Flag it as useless and fall back to Xf86VidMode, if available
_glfwInputError(GLFW_PLATFORM_ERROR,
"X11: RandR gamma ramp support seems broken");
_glfw.x11.randr.gammaBroken = GL_TRUE;
}