summaryrefslogtreecommitdiffstats
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 926be1014a8..34fbecf9563 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -887,9 +887,6 @@ glXCopyContext(Display * dpy, GLXContext source,
static Bool
__glXIsDirect(Display * dpy, GLXContextID contextID)
{
-#ifdef GLX_USE_APPLEGL /* TODO: apple indirect */
- return GC_IS_DIRECT(gc);
-#else
#if !defined(USE_XCB)
xGLXIsDirectReq *req;
xGLXIsDirectReply reply;
@@ -925,7 +922,6 @@ __glXIsDirect(Display * dpy, GLXContextID contextID)
return reply.isDirect;
#endif /* USE_XCB */
-#endif /* GLX_USE_APPLEGL */
}
/**
@@ -943,7 +939,11 @@ glXIsDirect(Display * dpy, GLXContext gc)
else if (GC_IS_DIRECT(gc)) {
return GL_TRUE;
}
+#ifdef GLX_USE_APPLEGL /* TODO: indirect on darwin */
+ return GL_FALSE;
+#else
return __glXIsDirect(dpy, gc->xid);
+#endif
}
PUBLIC GLXPixmap
@@ -1766,6 +1766,15 @@ static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
unsigned i;
_XRead(dpy, (char *) propList, nPropListBytes);
+
+ /* Look up screen first so we can look up visuals/fbconfigs later */
+ pProp = propList;
+ for (i = 0; i < numValues; i++, pProp += 2)
+ if (pProp[0] == GLX_SCREEN) {
+ ctx->screen = pProp[1];
+ ctx->psc = GetGLXScreenConfigs(dpy, ctx->screen);
+ }
+
pProp = propList;
for (i = 0; i < numValues; i++) {
switch (*pProp++) {
@@ -1776,9 +1785,6 @@ static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
ctx->mode =
_gl_context_modes_find_visual(ctx->psc->visuals, *pProp++);
break;
- case GLX_SCREEN:
- ctx->screen = *pProp++;
- break;
case GLX_FBCONFIG_ID:
ctx->mode =
_gl_context_modes_find_fbconfig(ctx->psc->configs,
@@ -1787,6 +1793,7 @@ static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
case GLX_RENDER_TYPE:
ctx->renderType = *pProp++;
break;
+ case GLX_SCREEN:
default:
pProp++;
continue;