path: root/src/platformsupport/glxconvenience
diff options
authorSean Harmer <>2012-09-18 17:05:01 +0100
committerThe Qt Project <>2012-09-26 19:21:15 +0200
commitaad58ac87e371129ee61168effd9daa491b476ab (patch)
tree7dfd20e817f1003eb008b75f8d27bd9194fd76d3 /src/platformsupport/glxconvenience
parent61d853797bff92d206db0d7fa6666c116f5ff00f (diff)
XCB: Correctly report the created OpenGL context version and profile
This commit fixes the xcb qpa plugin such that it now correctly reports the version and profile of the created OpenGL context in the QOpenGLSurfaceFormat. To do this we have to create a temporary X window so that we can make our new context current. We also handle the buggy nVidia drivers which incorrectly report 0 for the GL_CONTEXT_PROFILE_MASK query. The reduced format is also copied back from qglx_findVisualInfo. Change-Id: I6f34fe1c6130aebbb6b40c36df4acc216069d2b1 Reviewed-by: Samuel Rødal <>
Diffstat (limited to 'src/platformsupport/glxconvenience')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp
index a11af43671..ca5c1cb39d 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
+++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
@@ -210,6 +210,8 @@ XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *f
visualInfo = glXChooseVisual(display, screen,;
+ if (visualInfo)
+ *format = reducedFormat;
reducedFormat = qglx_reduceSurfaceFormat(reducedFormat, &reduced);