summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@qt.io>2022-03-17 17:57:14 +1000
committerRafael Roquetto <rafael.roquetto@qt.io>2022-03-21 12:12:54 +1000
commitd15ef5bc3ae4df5ddc374d4bc8fee736868f1628 (patch)
treed93ec79019c021fc120cb8fc9e486e6ce46a4863 /src/plugins/platforms/qnx
parent9d12f6adbc36fab274fb4a6b46247ad37f1d2ce1 (diff)
QNX: always create buffers for child windows
The QNX raster backend worked on the assumption that child windows were sharing their parent toplevel window buffer instead, and thus did not have a buffer of their own. This piece of code dates back from the BlackBerry days, and I am guessing the motivation was to tackle mmrenderer/foreign windows. In fact, not having buffers causes QWindow to malfunction, as independent buffers are required. This patch makes sure every QQnxWindow has a backing buffer, as expected. Foreign widnows shall be dealt with via different means. Change-Id: I059ac4f8ac684b3577048f874f82b866f21326b1 Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp16
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterwindow.cpp12
2 files changed, 7 insertions, 21 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index fe68927fda..95b8fb26e3 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -89,17 +89,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
if (!m_needsPosting)
return;
- QQnxWindow *targetWindow = nullptr;
- if (window)
- targetWindow = static_cast<QQnxWindow *>(window->handle());
-
- // we only need to flush the platformWindow backing store, since this is
- // the buffer where all drawing operations of all windows, including the
- // child windows, are performed; conceptually ,child windows have no buffers
- // (actually they do have a 1x1 placeholder buffer due to libscreen limitations),
- // since Qt will only draw to the backing store of the top-level window.
- if (!targetWindow || targetWindow == platformWindow())
- platformWindow()->post(region); // update the display with newly rendered content
+ auto *targetWindow = window
+ ? static_cast<QQnxRasterWindow *>(window->handle()) : platformWindow();
+
+ if (targetWindow)
+ targetWindow->post(region); // update the display with newly rendered content
m_needsPosting = false;
m_scrolled = false;
diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
index 0014ef8c6e..c91286217e 100644
--- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
@@ -177,9 +177,8 @@ void QQnxRasterWindow::setParent(const QPlatformWindow *wnd)
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(0,0) : window()->size();
+ const QSize windowSize = window()->size();
+
if (windowSize != bufferSize())
setBufferSize(windowSize);
}
@@ -195,13 +194,6 @@ 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 &region, int dx, int dy, bool flush)