summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Fedin <fedin-ilja2010@ya.ru>2021-09-13 21:03:23 +0400
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-28 20:03:11 +0000
commitf05bc311bb0e9f5f8acdee89e6cc213084a6d02d (patch)
tree06d1e15243d7d5a872efa68aa78a84a149a560dc
parentee20619e1fef9ff49b3982d70a699e0e61391039 (diff)
Let QXcbGlxWindow::createVisual fallback to QXcbWindow::createVisual
When flatpak refused to install org.freedesktop.Platform.GL.default for me, I got into a situation without GL drivers and Qt applications stopped getting transparency windows. They fallback to use root_visual and it doesn't provide sufaces with alpha, I tried to add fallback to QXcbWindow::createVisual just like QXcbEglWindow::createVisual does and voila, they got transparency. Change-Id: I9f401643b3ef231048c6e9e250121c96514101f5 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit d13ee2dc1a151ec7918ac900cf17a76978dd28f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
index c021388c5b..45fbe75333 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
@@ -58,7 +58,7 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
{
QXcbScreen *scr = xcbScreen();
if (!scr)
- return nullptr;
+ return QXcbWindow::createVisual();
qCDebug(lcQpaGl) << "Requested format before FBConfig/Visual selection:" << m_format;
@@ -71,10 +71,13 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
flags |= QGLX_SUPPORTS_SRGB;
}
+ const auto formatBackup = m_format;
XVisualInfo *visualInfo = qglx_findVisualInfo(dpy, scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags);
if (!visualInfo) {
- qWarning() << "No XVisualInfo for format" << m_format;
- return nullptr;
+ qCDebug(lcQpaGl) << "No XVisualInfo for format" << m_format;
+ // restore initial format before requesting it again
+ m_format = formatBackup;
+ return QXcbWindow::createVisual();
}
const xcb_visualtype_t *xcb_visualtype = scr->visualForId(visualInfo->visualid);
XFree(visualInfo);