summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 52c87ee8a4..35639d4b88 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -397,9 +397,12 @@ void QXcbWindow::create()
| XCB_CW_SAVE_UNDER
| XCB_CW_EVENT_MASK;
- static const bool haveOpenGL = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL);
+ static auto haveOpenGL = []() {
+ static const bool result = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL);
+ return result;
+ };
- if ((window()->supportsOpenGL() && haveOpenGL) || m_format.hasAlpha()) {
+ if ((window()->supportsOpenGL() && haveOpenGL()) || m_format.hasAlpha()) {
m_cmap = xcb_generate_id(xcb_connection());
xcb_create_colormap(xcb_connection(),
XCB_COLORMAP_ALLOC_NONE,