summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2010-05-17 08:20:30 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2010-05-17 08:20:30 (GMT)
commit4d4cb1023d693a2a4130e032c8894e0f56250f93 (patch)
tree24e3db8d63b7149b81c3b509fb5b820caf7ecbff /src/gui/kernel/qwidget.cpp
parent8fe40ca28e88d156b9a0ef9cc4c818a666499231 (diff)
parentbdbe09ad2c01ae11d10511b51f8d7a3dfb27b17c (diff)
downloadQt-4d4cb1023d693a2a4130e032c8894e0f56250f93.zip
Qt-4d4cb1023d693a2a4130e032c8894e0f56250f93.tar.gz
Qt-4d4cb1023d693a2a4130e032c8894e0f56250f93.tar.bz2
Merge commit 'qt/4.7' into 4.7
Conflicts: tests/benchmarks/declarative/binding/binding.pro tests/benchmarks/declarative/creation/creation.pro tests/benchmarks/declarative/creation/tst_creation.cpp tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 4a9fa94..1f2cd8c 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1581,6 +1581,11 @@ void QWidgetPrivate::createTLExtra()
x->inTopLevelResize = false;
x->inRepaint = false;
x->embedded = 0;
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ x->wasMaximized = false;
+#endif // QT_MAC_USE_COCOA
+#endif // Q_WS_MAC
createTLSysExtra();
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
@@ -6720,6 +6725,18 @@ void QWidget::setGeometry(const QRect &r)
*/
QByteArray QWidget::saveGeometry() const
{
+#ifdef QT_MAC_USE_COCOA
+ // We check if the window was maximized during this invocation. If so, we need to record the
+ // starting position as 0,0.
+ Q_D(const QWidget);
+ QRect newFramePosition = frameGeometry();
+ QRect newNormalPosition = normalGeometry();
+ if(d->topData()->wasMaximized && !(windowState() & Qt::WindowMaximized)) {
+ // Change the starting position
+ newFramePosition.moveTo(0, 0);
+ newNormalPosition.moveTo(0, 0);
+ }
+#endif // QT_MAC_USE_COCOA
QByteArray array;
QDataStream stream(&array, QIODevice::WriteOnly);
stream.setVersion(QDataStream::Qt_4_0);
@@ -6729,8 +6746,13 @@ QByteArray QWidget::saveGeometry() const
stream << magicNumber
<< majorVersion
<< minorVersion
+#ifdef QT_MAC_USE_COCOA
+ << newFramePosition
+ << newNormalPosition
+#else
<< frameGeometry()
<< normalGeometry()
+#endif // QT_MAC_USE_COCOA
<< qint32(QApplication::desktop()->screenNumber(this))
<< quint8(windowState() & Qt::WindowMaximized)
<< quint8(windowState() & Qt::WindowFullScreen);