summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/corelib/tools/qlocale.cpp1
-rw-r--r--src/gui/kernel/qwidget.cpp17
2 files changed, 11 insertions, 7 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 6b1de5e..2fb3616 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -7308,6 +7308,7 @@ Q_CORE_EXPORT char *qdtoa( double d, int mode, int ndigits, int *decpt, int *sig
Q_CORE_EXPORT double qstrtod(const char *s00, const char **se, bool *ok)
{
+ errno = 0;
double ret = strtod((char*)s00, (char**)se);
if (ok) {
if((ret == 0.0l && errno == ERANGE)
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;