From 2aef22b77aa15eb0863a9585af77ccab04425dbd Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 10 Dec 2012 11:19:52 +0100 Subject: Mac: make windows not restorable on 10.7 and later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/platforms/cocoa/qcocoawindow.mm | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- cgit v1.2.3