summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoawindowdelegate_mac.mm
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-03 15:53:33 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-04 10:38:49 (GMT)
commit4567799c51b4126c693746e7c5c963faddb40225 (patch)
tree041130dacc229f24659d77e813cb78000b83664d /src/gui/kernel/qcocoawindowdelegate_mac.mm
parent51c9b68425c1d3fe64a08e6ef0357fbd6bdd8f8a (diff)
downloadQt-4567799c51b4126c693746e7c5c963faddb40225.zip
Qt-4567799c51b4126c693746e7c5c963faddb40225.tar.gz
Qt-4567799c51b4126c693746e7c5c963faddb40225.tar.bz2
Save the normal geometry on mac before the window is maximized
Do the same as on Windows - before the window is maximized save its normal geometry so that when the window is restored we set the geometry back. Task-number: QTBUG-4418 Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/kernel/qcocoawindowdelegate_mac.mm')
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm
index 803a1b1..9fb674e 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac.mm
+++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm
@@ -307,6 +307,18 @@ static void cleanupCocoaWindowDelegate()
return m_windowHash->value(window);
}
+- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame
+{
+ Q_UNUSED(newFrame);
+ // saving the current window geometry before the window is maximized
+ QWidget *qwidget = m_windowHash->value(window);
+ if (qwidget->isWindow() && !(qwidget->windowState() & Qt::WindowMaximized)) {
+ QWidgetPrivate *widgetPrivate = qt_widget_private(qwidget);
+ widgetPrivate->topData()->normalGeometry = qwidget->geometry();
+ }
+ return YES;
+}
+
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)defaultFrame
{
NSRect frameToReturn = defaultFrame;