diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2019-11-18 19:46:42 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-09-25 21:54:15 +0000 |
commit | d4bf9aafdd36aa4215b64e2df484a09fb728a47e (patch) | |
tree | 784608c415eae6631cb61d28217ea8d18b6e15b6 /src | |
parent | 0a82f6ed6d339937f3cfeb97d9f066b5293d2afa (diff) |
xcb: Avoid BadMatch error when creating non-OpenGL window
The Xorg Server requires colormap when creating a window if
the window's parent either has a different visual or has no
colormap. To simplify logic and avoid extra requests, create
a new window with colormap unconditionally.
Change-Id: I21a53f9146ae0a03b38bb3a07c8a478043a2eb89
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 065c4021adab9dee72d0cb815a27e17e8fc4db1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 72b8dc1312..9e7e1a5572 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -368,18 +368,8 @@ void QXcbWindow::create() | XCB_CW_BIT_GRAVITY | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER - | XCB_CW_EVENT_MASK; - - static auto haveOpenGL = []() { - static const bool result = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL); - return result; - }; - - xcb_colormap_t cmap = XCB_COLORMAP_NONE; - if ((window()->supportsOpenGL() && haveOpenGL()) || m_format.hasAlpha()) { - cmap = platformScreen->colormapForVisual(m_visualId); - mask |= XCB_CW_COLORMAP; - } + | XCB_CW_EVENT_MASK + | XCB_CW_COLORMAP; quint32 values[] = { XCB_BACK_PIXMAP_NONE, @@ -388,7 +378,7 @@ void QXcbWindow::create() type == Qt::Popup || type == Qt::ToolTip || (window()->flags() & Qt::BypassWindowManagerHint), type == Qt::Popup || type == Qt::Tool || type == Qt::SplashScreen || type == Qt::ToolTip || type == Qt::Drawer, defaultEventMask, - cmap + platformScreen->colormapForVisual(m_visualId) }; m_window = xcb_generate_id(xcb_connection()); |