path: root/src/plugins/platforms/cocoa
diff options
authorLiang Qi <>2012-12-10 11:19:52 +0100
committerThe Qt Project <>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 <>
Diffstat (limited to 'src/plugins/platforms/cocoa')
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/ b/src/plugins/platforms/cocoa/
index 551e51bfa9..463c065c9a 100644
--- a/src/plugins/platforms/cocoa/
+++ b/src/plugins/platforms/cocoa/
@@ -710,6 +710,11 @@ NSWindow * QCocoaWindow::createNSWindow()
createdWindow = window;
+ if ([createdWindow respondsToSelector:@selector(setRestorable:)])
+ [createdWindow setRestorable: NO];
NSInteger level = windowLevel(flags);
[createdWindow setLevel:level];
m_windowModality = window()->modality();