summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindowsysteminterface.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2013-11-06 12:43:51 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-06 17:47:25 +0100
commitd8f7a2ddf4e098786a5dec27e11786f5ff4e0433 (patch)
tree60196978dec76d4d333601404aa1dc1030e171fb /src/gui/kernel/qwindowsysteminterface.cpp
parentbc302359caad43919a72c3747f821a21810d200d (diff)
EglFS: make sure resize events are delivered
Make sure that resize events are delivered when the platform plugin overrides the geometry set in setGeometry(). This fixes a race condition where a widget was resized to its sizeHint() while the window was maximized, and the content was shown scaled on the screen. The problem is that the widget gets the wrong size from QWidget::setWindowState() (which calls adjustSize() in order to support normalGeometry). This size is used to resize the backingStore. When the QWindow is resized, it calls QEglFSWindow::setGeometry() which corrects the size to screen()->availableGeometry(), and triggers a GeometryChangeEvent since the size was corrected. This ends up in QGuiApplicationPrivate::processGeometryChangeEvent() which will not send a resize event, since the size has not changed (it is always availableGeometry()). Therefore the widget is never resized, and the backingStore remains the wrong size. Task-number: QTBUG-34421 Change-Id: Iee49c53cc529de36010db2695d838d8c2284edd4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 902c32419d..8ef275a27c 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -141,9 +141,12 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect)
+/*!
+ If \a oldRect is null, Qt will use the previously reported geometry instead.
+ */
+void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
{
- QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect);
+ QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect, oldRect);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}