xcb: Do not crash with VNC

When having a vnc server with pixel format bgr888, we may not have
a working GL integration. (we may not have one regardless of the
pixel format in fact)

We should still keep on attempting to create a regular SHM window
for RasterGLSurface windows too, to keep regular widgets apps working.

Task-number: QTBUG-42776
Change-Id: Idbf8de29694613b240bd27affcc3d80810ce1460
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
Laszlo Agocs 2015-03-26 16:52:09 +01:00
parent 0599ffd5d6
commit bc6e92bd2e
2 changed files with 5 additions and 4 deletions

View File

@ -1137,7 +1137,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
}
}
if (!handled)
if (!handled && m_glIntegration)
handled = m_glIntegration->handleXcbEvent(event, response_type);
if (handled)

View File

@ -186,9 +186,9 @@ QXcbIntegration::~QXcbIntegration()
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
{
QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
if (window->type() != Qt::Desktop) {
QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
if (glIntegration) {
QXcbWindow *xcbWindow = glIntegration->createWindow(window);
xcbWindow->create();
@ -196,7 +196,8 @@ QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
}
}
Q_ASSERT(window->type() == Qt::Desktop || !window->supportsOpenGL());
Q_ASSERT(window->type() == Qt::Desktop || !window->supportsOpenGL()
|| (!glIntegration && window->surfaceType() == QSurface::RasterGLSurface)); // for VNC
QXcbWindow *xcbWindow = new QXcbWindow(window);
xcbWindow->create();
return xcbWindow;