|
|
@ -475,6 +475,8 @@ static GLboolean initExtensions(void) |
|
|
|
|
|
|
|
|
|
|
|
if (_glfw.x11.randr.available) |
|
|
|
if (_glfw.x11.randr.available) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
XRRScreenResources* sr; |
|
|
|
|
|
|
|
|
|
|
|
if (!XRRQueryVersion(_glfw.x11.display, |
|
|
|
if (!XRRQueryVersion(_glfw.x11.display, |
|
|
|
&_glfw.x11.randr.versionMajor, |
|
|
|
&_glfw.x11.randr.versionMajor, |
|
|
|
&_glfw.x11.randr.versionMinor)) |
|
|
|
&_glfw.x11.randr.versionMinor)) |
|
|
@ -490,6 +492,21 @@ static GLboolean initExtensions(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_glfw.x11.randr.available = GL_FALSE; |
|
|
|
_glfw.x11.randr.available = GL_FALSE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!sr->ncrtc || !XRRGetCrtcGammaSize(_glfw.x11.display, sr->crtcs[0])) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// This is either a headless system or an older Nvidia binary driver
|
|
|
|
|
|
|
|
// with broken gamma support
|
|
|
|
|
|
|
|
// Flag it as useless and fall back to Xf86VidMode gamma, if
|
|
|
|
|
|
|
|
// available
|
|
|
|
|
|
|
|
_glfwInputError(GLFW_PLATFORM_ERROR, |
|
|
|
|
|
|
|
"X11: RandR gamma ramp support seems broken"); |
|
|
|
|
|
|
|
_glfw.x11.randr.gammaBroken = GL_TRUE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XRRFreeScreenResources(sr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (XQueryExtension(_glfw.x11.display, |
|
|
|
if (XQueryExtension(_glfw.x11.display, |
|
|
@ -701,7 +718,6 @@ int _glfwPlatformInit(void) |
|
|
|
|
|
|
|
|
|
|
|
_glfwInitTimer(); |
|
|
|
_glfwInitTimer(); |
|
|
|
_glfwInitJoysticks(); |
|
|
|
_glfwInitJoysticks(); |
|
|
|
_glfwInitGammaRamp(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GL_TRUE; |
|
|
|
return GL_TRUE; |
|
|
|
} |
|
|
|
} |
|
|
|