From 2cc3763d0455de13e78a82123ddc47a00e5ea7eb Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 6 Jan 2023 12:24:11 -0500 Subject: [PATCH] glx: Fix drawable type inference in visual/fbconfig setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was just all kinds of wrong. Note that the comment implying "this is a workaround for old XQuartz" is on the "not apple" side of the ifdef. Anyway. xserver didn't start sending GLX_DRAWABLE_TYPE in the fbconfig until: commit 8cde0af3c57f0375ba8ba77af9fdf74b79d9496d Author: Kristian Høgsberg Date: Wed Apr 2 19:06:40 2008 -0400 Send the GLX_EXT_texture_from_pixmap attributes to the client. So we can remove this default from the fbconfig path. But we preserve it for the GLXGetVisualConfigs path, because that is specified not to send GLX_DRAWABLE_TYPE. Part-of: --- src/glx/glxext.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/glx/glxext.c b/src/glx/glxext.c index b1b98a9fadd..755a75ab568 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -651,18 +651,15 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, m = modes; for (i = 0; i < nvisuals; i++) { _XRead(dpy, (char *) props, prop_size); -#ifdef GLX_USE_APPLEGL - /* Older X servers don't send this so we default it here. */ - m->drawableType = GLX_WINDOW_BIT; -#else - /* - * The XQuartz 2.3.2.1 X server doesn't set this properly, so - * set the proper bits here. - * AppleSGLX supports windows, pixmaps, and pbuffers with all config. + /* If this is GLXGetVisualConfigs then the reply will not include + * any drawable type info, but window support is implied because + * that's what a Visual describes, and pixmap support is implied + * because you almost certainly have a pixmap format corresponding + * to your visual format. */ - m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; -#endif - __glXInitializeVisualConfigFromTags(m, nprops, props, + if (!tagged_only) + m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + __glXInitializeVisualConfigFromTags(m, nprops, props, tagged_only, GL_TRUE); m->screen = screen; m = m->next;