summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Fedin <fedin-ilja2010@ya.ru>2021-09-13 21:03:23 +0400
committerLiang Qi <liang.qi@qt.io>2022-01-28 16:15:28 +0100
commitd13ee2dc1a151ec7918ac900cf17a76978dd28f1 (patch)
tree1c94218859ffe630c1d217287c987d3c417429d9
parent1acdb290e8b5f27a4a686481aad46fa493439163 (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. Pick-to: 6.3 6.2 5.15 Change-Id: I9f401643b3ef231048c6e9e250121c96514101f5 Reviewed-by: Liang Qi <liang.qi@qt.io>
-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);