From abc29084fadf9c7d936fca55d02323090d9986cc Mon Sep 17 00:00:00 2001 From: Roger Maclean Date: Wed, 29 Oct 2014 11:06:20 -0400 Subject: QNX: Ensure invisible 1x1 raster windows are posted. Non-top level raster windows still have screen windows associated with them though they are not intended to be visible. This causes problems if they have children (as they do when QGLWidgets are used) since their children will also not be visible. So, if we have a window with a parent, force them to post but set the transparency to discard so they remain invisible. This allows the example hellogl_es2 to run correctly. Change-Id: I67e24dc59b29ce789376498c2477349fa50020e1 Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 9 ++++++++- src/plugins/platforms/qnx/qqnxwindow.cpp | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index 933fce0e33..a764bba00e 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -172,7 +172,7 @@ void QQnxRasterWindow::adjustBufferSize() { // When having a raster window we don't need any buffers, since // Qt will draw to the parent TLW backing store. - const QSize windowSize = window()->parent() ? QSize(1,1) : window()->size(); + const QSize windowSize = window()->parent() ? QSize(0,0) : window()->size(); if (windowSize != bufferSize()) setBufferSize(windowSize); } @@ -188,6 +188,13 @@ void QQnxRasterWindow::resetBuffers() m_currentBufferIndex = -1; m_previousDirty = QRegion(); m_scrolled = QRegion(); + if (window()->parent() && bufferSize() == QSize(1,1)) { + // If we have a parent then we're not really rendering. But if we don't render we'll + // be invisible and any children won't show up. This should be harmless since we're + // rendering into a 1x1 window that has transparency set to discard. + renderBuffer(); + post(QRegion(0,0,1,1)); + } } void QQnxRasterWindow::blitPreviousToCurrent(const QRegion ®ion, int dx, int dy, bool flush) diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 4dc1248bd1..da2929d4c0 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -386,7 +386,12 @@ 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) { + if (size.isEmpty()) { + // We can't create 0x0 buffers and instead make them 1x1. But to allow these windows to + // still be 'visible' (thus allowing their children to be visible), we need to allow + // them to be posted but still not show up. + val[0] = SCREEN_TRANSPARENCY_DISCARD; + } else 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; -- cgit v1.2.3