summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_p.h
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-05-14 09:41:05 (GMT)
committerCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-05-14 09:56:17 (GMT)
commite0c4899b46a68b37ce743c5a1ffd17596cbaa44c (patch)
treeae1649c4ca477014ebea1cf255984ea30a04f411 /src/gui/kernel/qwidget_p.h
parent23f1fa2e47f3bd4cea92510d70c2e9d0fbbcfc92 (diff)
downloadQt-e0c4899b46a68b37ce743c5a1ffd17596cbaa44c.zip
Qt-e0c4899b46a68b37ce743c5a1ffd17596cbaa44c.tar.gz
Qt-e0c4899b46a68b37ce743c5a1ffd17596cbaa44c.tar.bz2
Mac: restoreGeometry()
The problem here is the fact that when zooming (maximizing) a window, we should update the starting position since the window is now starting at 0,0. However when restoring the window should be placed in the original position. The bug here occurs because we kept the original position and the new size. So the window was drawn were it was using the new size. This patch introduces a boolean flag that keeps track of the maximized state. We are interested in knowing if the window was maximized but not restored, so when saving the geometry we have a way to know that we need to "move" the window to 0,0. Task-number: QTBUG-10504 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qwidget_p.h')
-rw-r--r--src/gui/kernel/qwidget_p.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index cad60b5..3f494d8 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -170,6 +170,14 @@ struct QTLWExtra {
WindowGroupRef group;
IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys.
quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys()
+#ifdef QT_MAC_USE_COCOA
+ // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and
+ // manually resized.
+ // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the
+ // starting position as 0,0 instead of the normal starting position.
+ bool wasMaximized;
+#endif // QT_MAC_USE_COCOA
+
#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
#ifndef QT_NO_QWS_MANAGER
QWSManager *qwsManager;