From aad58ac87e371129ee61168effd9daa491b476ab Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 18 Sep 2012 17:05:01 +0100 Subject: XCB: Correctly report the created OpenGL context version and profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/platformsupport/glxconvenience/qglxconvenience.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/platformsupport/glxconvenience') 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 attribs.append(XNone); visualInfo = glXChooseVisual(display, screen, attribs.data()); + if (visualInfo) + *format = reducedFormat; reducedFormat = qglx_reduceSurfaceFormat(reducedFormat, &reduced); } -- cgit v1.2.3