Patch toward fixing tst_QWidget::windowState().
authorSamuel Rødal <samuel.rodal@nokia.com>
Thu, 22 Sep 2011 07:05:11 +0000 (09:05 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Sep 2011 09:31:12 +0000 (11:31 +0200)
commit294df24621ddd4e08ca792cd8e541dcc84409acb
tree8bfda5a5f20791addb6fff6b530a334dce2301e6
parent5fb67c1dacce58c034980c5c559f74ce9ec2c756
Patch toward fixing tst_QWidget::windowState().

In QWidget::setWindowState() there was some code to emulate window
states when they're not supported by the backend, by hiding the window
on minimize or using the screen geometry and the frameless window hint
to manually try to make a window fullscreen.

However, some of this code was being run even when the backend does
support setting window states, specifically calling setParent(0) to
force a re-creation of the platform window and calling show(). These led
to the window getting the wrong position after being minimized or
fullscreen and going back to the normal state.

Apart from storing the normal geometry of a widget when going away from
the normal state we shouldn't do any magic when the call to
QPlatformWindow::setWindowState() succeeds.

tst_QWidget::windowState() still fails due to calling move() to set the
position of the widget including the frame, when QWindow currently only
supports setting the position of the widget excluding the frame.

Change-Id: I1c1a337d3c15f14c1c842bd1e347f94e6b67d7eb
Reviewed-on: http://codereview.qt-project.org/5367
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/widgets/kernel/qwidget_qpa.cpp
tests/auto/qwidget/tst_qwidget.cpp