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;
|
QScopedPointer<QSurface> surface;
|
||||||
Display *display = glXGetCurrentDisplay();
|
Display *display = glXGetCurrentDisplay();
|
||||||
const char *glxvendor = 0;
|
if (!display) {
|
||||||
if (display)
|
// FIXME: Since Qt 5.6 we don't need to check whether primary screen is NULL
|
||||||
glxvendor = glXGetClientString(display, GLX_VENDOR);
|
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")) {
|
if (glxvendor && !strcmp(glxvendor, "ATI")) {
|
||||||
QWindow *window = new QWindow;
|
QWindow *window = new QWindow;
|
||||||
window->resize(64, 64);
|
window->resize(64, 64);
|
||||||
|
@ -196,9 +196,11 @@ QPlatformOffscreenSurface *QXcbGlxIntegration::createPlatformOffscreenSurface(QO
|
|||||||
if (!vendorChecked) {
|
if (!vendorChecked) {
|
||||||
vendorChecked = true;
|
vendorChecked = true;
|
||||||
Display *display = glXGetCurrentDisplay();
|
Display *display = glXGetCurrentDisplay();
|
||||||
const char *glxvendor = 0;
|
#ifdef XCB_USE_XLIB
|
||||||
if (display)
|
if (!display)
|
||||||
glxvendor = glXGetClientString(display, GLX_VENDOR);
|
display = static_cast<Display *>(m_connection->xlib_display());
|
||||||
|
#endif
|
||||||
|
const char *glxvendor = glXGetClientString(display, GLX_VENDOR);
|
||||||
if (glxvendor && !strcmp(glxvendor, "ATI"))
|
if (glxvendor && !strcmp(glxvendor, "ATI"))
|
||||||
glxPbufferUsable = false;
|
glxPbufferUsable = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user