diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2013-11-05 12:06:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-10 15:37:51 +0100 |
commit | b088e4827f427189334e8a1c5b4f2b8b0b713fc2 (patch) | |
tree | e792c60db729c186f739b9e8e1553d9184272c58 /src/plugins/platforms | |
parent | eb5c0f4b1266702c016b032e281bb92a3a642da6 (diff) |
Fix bug on X11 with WA_TranslucentBackground and native child windows.
The native child windows need to inherit the parent's visual in order
to have a translucent background as well.
Surface with type QSurface::OpenGLSurface should not be forced to use
the parent window's visual - the parent visual for instance, might not
even be GL capable.
Changing WA_TranslucentBackground during runtime is not supported, for
two reasons:
1) Other platform plugins seem not to support it
2) It would require recreating X windows.
Task-number: QTBUG-29625
Change-Id: Ic1474dd2de99069027481c7db6bf865f9b8d616d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index e2c6932992..f46bed77d6 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -280,8 +280,12 @@ void QXcbWindow::create() if (parent()) { xcb_parent_id = static_cast<QXcbWindow *>(parent())->xcb_window(); m_embedded = parent()->window()->type() == Qt::ForeignWindow; - } + QSurfaceFormat parentFormat = parent()->window()->requestedFormat(); + if (window()->surfaceType() != QSurface::OpenGLSurface && parentFormat.hasAlpha()) { + window()->setFormat(parentFormat); + } + } m_format = window()->requestedFormat(); #if (defined(XCB_USE_GLX) || defined(XCB_USE_EGL)) && defined(XCB_USE_XLIB) |