diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2018-09-18 14:26:22 +0300 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-09-29 09:33:04 +0000 |
commit | 60cecc86f8cde0b2d4e727b9d0fe8a6cb994d660 (patch) | |
tree | 823b6a1f0f8bd21854e2e32da1939c91642cfa22 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | e4a5483eaedaba8437441868dd87e14d1f605430 (diff) |
xcb: Initialize OpenGL integration only when required
In some cases OpenGL integration may be unnecessary, e.g.
an application may set Qt::AA_ForceRasterWidgets attribute
and don't use OpenGL in any other way. In addition OpenGL
initialization can take noticeable time on some configurations.
So do it on demand only.
Change-Id: If88953f8d5c826bc96fd49eb397b5e1ad693546d
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 1ac5445035..7458643ae5 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -231,11 +231,11 @@ QPlatformPixmap *QXcbIntegration::createPlatformPixmap(QPlatformPixmap::PixelTyp QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const { - QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle()); - QXcbGlIntegration *glIntegration = screen->connection()->glIntegration(); + QXcbGlIntegration *glIntegration = nullptr; const bool isTrayIconWindow = window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); if (window->type() != Qt::Desktop && !isTrayIconWindow) { if (window->supportsOpenGL()) { + glIntegration = defaultConnection()->glIntegration(); if (glIntegration) { QXcbWindow *xcbWindow = glIntegration->createWindow(window); xcbWindow->create(); |