diff options
author | Błażej Szczygieł <spaz16@wp.pl> | 2016-01-16 00:57:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-01-18 14:34:58 +0000 |
commit | e8ad49d6cba6521f20b1b08bf65d92fc81c158e4 (patch) | |
tree | 44d75ccc49ff850cfe56f18a8cbd8b687c604ea5 /src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | |
parent | 5ef14c52d0275e721153b15acfb0410b9889014a (diff) |
xcb: Fallback to Xlib screen when glXGetCurrentDisplay() returns NULL
Change-Id: Ie25b3fac4c0224f847c77c0515894a9df84077a2
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
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 | 9 |
1 files changed, 6 insertions, 3 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 3412f3f3fc..22e68e3db7 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -645,9 +645,12 @@ void QGLXContext::queryDummyContext() QScopedPointer<QSurface> surface; Display *display = glXGetCurrentDisplay(); - const char *glxvendor = 0; - if (display) - glxvendor = glXGetClientString(display, GLX_VENDOR); + 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); |