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>bb10
parent
1acdb290e8
commit
d13ee2dc1a
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue