From 6cb89175a7790dbcaa39d54ca863e1d28e4f84db Mon Sep 17 00:00:00 2001 From: Braden Pellett Date: Fri, 1 Jun 2012 00:08:34 -0700 Subject: [PATCH] Emit an error when gamma ramp cannot be get/set due to size not being GLFW_GAMMA_RAMP_SIZE. --- src/x11_gamma.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/x11_gamma.c b/src/x11_gamma.c index edd71846..44cd1139 100644 --- a/src/x11_gamma.c +++ b/src/x11_gamma.c @@ -113,7 +113,12 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp) { // For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) - return; + { + _glfwSetError(GLFW_PLATFORM_ERROR, + "X11/GLX: Failed to get gamma ramp due to size " + "incompatibility"); + return; + } if (_glfwLibrary.X11.RandR.available && !_glfwLibrary.X11.RandR.gammaBroken) @@ -159,7 +164,12 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp) { // For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) - return; + { + _glfwSetError(GLFW_PLATFORM_ERROR, + "X11/GLX: Failed to set gamma ramp due to size " + "incompatibility"); + return; + } if (_glfwLibrary.X11.RandR.available && !_glfwLibrary.X11.RandR.gammaBroken)