summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2013-06-17 16:46:39 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-26 21:41:49 +0200
commit4a3edb5aec8afbd19e9a9fa7ba9795681eb7a064 (patch)
treef830b4d228a83f056ddacabbbb447351648335de /src/plugins/platforms
parent505617b171ece4cef57fa64512801199178dde7a (diff)
QNX: Fix screen rotation
The behavior introduced by qtdeclarative's 475d1ed4f6a2 mandates that an expose event follows a geometry change event. The fix for this uncovered a bug on the raster backing store which caused the rotation to break on QtWidgets. The problem was rooted on the assumption that the QQnxRasterBackingStore::flush() method was only called after paints to the backing store surface, which was discovered to be a false assumption. Flushing the backing store can occur in other circunstances, which are out of scope on the context of the QNX plugin. Task-number: QTBUG-31329 Task-number: QTBUG-31934 Change-Id: Icfc3e85324f5a8745f6b5f189f27f8b763f770c7 (cherry picked from commit 0343b926608a4014ef386b3b21be9a0940d9f8e8) Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Vladimir Minenko <vminenko@rim.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 7204e5bce9..6a7a4d0944 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -81,6 +81,12 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window();
+ // Sometimes this method is called even though there is nothing to be
+ // flushed, for instance, after an expose event directly follows a
+ // geometry change event.
+ if (!m_hasUnflushedPaintOperations)
+ return;
+
QQnxWindow *targetWindow = 0;
if (window)
targetWindow = static_cast<QQnxWindow *>(window->handle());
@@ -117,7 +123,6 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
// We assume that the TLW has been flushed previously and that no changes were made to the
// backing store inbetween (### does Qt guarantee this?)
- Q_ASSERT(!m_hasUnflushedPaintOperations);
targetWindow->adjustBufferSize();
targetWindow->blitFrom(platformWindow, offset, region);
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 9523685f70..7daab24d3c 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -200,6 +200,7 @@ void QQnxWindow::setGeometry(const QRect &rect)
// could result in re-entering QQnxWindow::setGeometry() again.
QWindowSystemInterface::setSynchronousWindowsSystemEvents(true);
QWindowSystemInterface::handleGeometryChange(window(), rect);
+ QWindowSystemInterface::handleExposeEvent(window(), rect);
QWindowSystemInterface::setSynchronousWindowsSystemEvents(false);
// Now move all children.