diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-24 00:56:59 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-24 00:56:59 +0100 |
commit | f0fbff4c905fd3e21d7aefedd45d98cc9dd54018 (patch) | |
tree | c61f47f858a9ac6183676bd7aee378a6a2b84a19 /src/plugins/platforms/qnx/qqnxwindow.cpp | |
parent | d776937df91e46536f404c6868d64016b6038d7b (diff) | |
parent | 0e1ce36ae67de940b2d499ec7f23e520dce0f112 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxwindow.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index ee539e9aed..9f8c93cce1 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -323,6 +323,26 @@ void QQnxWindow::setBufferSize(const QSize &size) } } + // Set the transparency. According to QNX technical support, setting the window + // transparency property should always be done *after* creating the window + // buffers in order to guarantee the property is paid attention to. + if (window()->requestedFormat().alphaBufferSize() == 0) { + // To avoid overhead in the composition manager, disable blending + // when the underlying window buffer doesn't have an alpha channel. + val[0] = SCREEN_TRANSPARENCY_NONE; + } else { + // Normal alpha blending. This doesn't commit us to translucency; the + // normal backfill during the painting will contain a fully opaque + // alpha channel unless the user explicitly intervenes to make something + // transparent. + val[0] = SCREEN_TRANSPARENCY_SOURCE_OVER; + } + + errno = 0; + result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_TRANSPARENCY, val); + if (result != 0) + qFatal("QQnxWindow: failed to set window transparency, errno=%d", errno); + // Cache new buffer size m_bufferSize = nonEmptySize; resetBuffers(); @@ -551,17 +571,6 @@ void QQnxWindow::initWindow() if (result != 0) qFatal("QQnxWindow: failed to set window alpha mode, errno=%d", errno); - // Blend the window with Source Over Porter-Duff behavior onto whatever's - // behind it. - // - // If the desired use-case is opaque, the Widget painting framework will - // already fill in the alpha channel with full opacity. - errno = 0; - val = SCREEN_TRANSPARENCY_SOURCE_OVER; - result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_TRANSPARENCY, &val); - if (result != 0) - qFatal("QQnxWindow: failed to set window transparency, errno=%d", errno); - // Set the window swap interval errno = 0; val = 1; |