From faa29c0e2449e3d7521bc273d723012b537593df Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sat, 14 Jul 2018 15:24:14 +0100 Subject: Make glXChooseFBConfig handle unspecified sRGB correctly Make glXChooseFBConfig properly handle the case where the only matching configs have the sRGB flag set, but no sRGB attribute is specified. Since 6e06e281, the sRGBcapable flag is now actually compared, using MATCH_DONT_CARE. 7b0f912e added defaulting of sRGBcapable to GL_FALSE in __glXInitializeVisualConfigFromTags(), to handle servers which don't report it, but this function is also used by glXChooseFBConfig(), so sRGBcapable is implicitly false when not explicitly specified. (This can cause e.g. glxinfo to fail to find anything matching the simple config it looks for if all the candidates have the sRGB flag set to true. I'm assuming this doesn't happen 'normally' as candidate configs with and without sRGB true are available) Move this defaulting to createConfigsFromProperties(), and set the default for glXChooseFBConfig() in init_fbconfig_for_chooser() to GLX_DONT_CARE. Reviewed-by: Eric Anholt --- src/glx/glxcmds.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glx/glxcmds.c') diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index e8485acd809..4db0228eaba 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -937,6 +937,7 @@ init_fbconfig_for_chooser(struct glx_config * config, config->fbconfigID = (GLXFBConfigID) (GLX_DONT_CARE); config->swapMethod = GLX_DONT_CARE; + config->sRGBCapable = GLX_DONT_CARE; } #define MATCH_DONT_CARE( param ) \ -- cgit v1.2.3