diff options
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index eea7e6a2d4..ff624d9755 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -658,7 +658,13 @@ void QGLXContext::queryDummyContext() oldSurface = oldContext->surface(); QScopedPointer<QSurface> surface; - const char *glxvendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR); + Display *display = glXGetCurrentDisplay(); + if (!display) { + // FIXME: Since Qt 5.6 we don't need to check whether primary screen is NULL + if (QScreen *screen = QGuiApplication::primaryScreen()) + display = DISPLAY_FROM_XCB(static_cast<QXcbScreen *>(screen->handle())); + } + const char *glxvendor = glXGetClientString(display, GLX_VENDOR); if (glxvendor && !strcmp(glxvendor, "ATI")) { QWindow *window = new QWindow; window->resize(64, 64); |