summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-16 07:27:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-16 07:27:33 (GMT)
commit71fdd7b0420d75c8bc147867dbfccf5077ed5a9f (patch)
tree4a7c506f57fcb126127de98843b9016bb58030be /src/gui
parent0b0957d5d032a65bad995f8a1ba689267a4b3644 (diff)
parentabba37cd0eff959edf2d011842cbf2b36cce8467 (diff)
downloadQt-71fdd7b0420d75c8bc147867dbfccf5077ed5a9f.zip
Qt-71fdd7b0420d75c8bc147867dbfccf5077ed5a9f.tar.gz
Qt-71fdd7b0420d75c8bc147867dbfccf5077ed5a9f.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Improve restoring of miximized window geomertry. Fix wrong error assumption when converting "0.0" to double
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index cd1c9f0..7714acb 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -7051,13 +7051,16 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
restoredNormalGeometry.moveTop(qMax(restoredNormalGeometry.top(), availableGeometry.top() + frameHeight));
if (maximized || fullScreen) {
- // set geomerty before setting the window state to make
- // sure the window is maximized to the right screen.
- // Skip on windows: the window is restored into a broken
- // half-maximized state.
-#ifndef Q_WS_WIN
- setGeometry(restoredNormalGeometry);
-#endif
+ // Set the geomerty before setting the maximized/fullscreen
+ // window state to make sure the window is maximized to the
+ // correct screen. Clear the window state before setting the
+ // geometry to prevent a bug where the window is restored to
+ // an inconsitent state on Windows.
+ if (desktop->screenNumber(restoredNormalGeometry.center()) != desktop->screenNumber(this)) {
+ setWindowState(Qt::WindowNoState);
+ setGeometry(restoredNormalGeometry);
+ }
+
Qt::WindowStates ws = windowState();
if (maximized)
ws |= Qt::WindowMaximized;