summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbintegration.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-03-26 16:52:09 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-03-27 16:36:16 +0000
commitbc6e92bd2ed7e39dcb856c3e275886e1e69df4c3 (patch)
treed07575028873fca63fd31e39a4305746eef63741 /src/plugins/platforms/xcb/qxcbintegration.cpp
parent0599ffd5d6e91c963e5cb4855c1e3095e94fbf4a (diff)
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>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 04c527c687..2547e537a7 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -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;