summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2012-12-10 11:19:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-29 16:05:54 +0100
commit2aef22b77aa15eb0863a9585af77ccab04425dbd (patch)
treea8b22fa20d0aa341a666145ab0b4f53c4b94faf0 /src/plugins/platforms/cocoa
parent7d757fc8feb5090b464f65fe243b6a88eb1f8f3e (diff)
Mac: make windows not restorable on 10.7 and later
The default value for NSWindow::setRestorable: is true, it means application will have some information for each window stored. After a crash happened and application relaunched, the application tries to restore those windows from the broken file. And then the "Retore Windows" will pop up. There is no workaround for application users or develoeprs. What they can do is to manually remove the the saved application state file for the applicaiton. To avoid that, better to switch it off. Task-number: QTBUG-28281 Change-Id: I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 551e51bfa9..463c065c9a 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -710,6 +710,11 @@ NSWindow * QCocoaWindow::createNSWindow()
createdWindow = window;
}
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ if ([createdWindow respondsToSelector:@selector(setRestorable:)])
+ [createdWindow setRestorable: NO];
+#endif
+
NSInteger level = windowLevel(flags);
[createdWindow setLevel:level];
m_windowModality = window()->modality();