xcb: Fallback to Xlib screen when glXGetCurrentDisplay() returns NULL
Change-Id: Ie25b3fac4c0224f847c77c0515894a9df84077a2 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
5ef14c52d0
commit
e8ad49d6cb
@ -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);
|
||||
|
@ -196,9 +196,11 @@ QPlatformOffscreenSurface *QXcbGlxIntegration::createPlatformOffscreenSurface(QO
|
||||
if (!vendorChecked) {
|
||||
vendorChecked = true;
|
||||
Display *display = glXGetCurrentDisplay();
|
||||
const char *glxvendor = 0;
|
||||
if (display)
|
||||
glxvendor = glXGetClientString(display, GLX_VENDOR);
|
||||
#ifdef XCB_USE_XLIB
|
||||
if (!display)
|
||||
display = static_cast<Display *>(m_connection->xlib_display());
|
||||
#endif
|
||||
const char *glxvendor = glXGetClientString(display, GLX_VENDOR);
|
||||
if (glxvendor && !strcmp(glxvendor, "ATI"))
|
||||
glxPbufferUsable = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user