summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-08-06 05:34:45 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-11 12:30:21 (GMT)
commitf7efbae117595c2503ca85bfca7f27e0b6a92328 (patch)
tree761c46d37da54fc97d9cfc2a9e972cdfc08a5ef4 /src/plugins/platforms/cocoa
parent4a2c688e2a0542e450a6405a74cda4762555af4f (diff)
downloadQt-f7efbae117595c2503ca85bfca7f27e0b6a92328.zip
Qt-f7efbae117595c2503ca85bfca7f27e0b6a92328.tar.gz
Qt-f7efbae117595c2503ca85bfca7f27e0b6a92328.tar.bz2
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 application. To avoid that, better to switch it off. Task-number: QTBUG-28281 Change-Id: I4cc81b51b157139ff5e299e85a9bbce05f544219 (cherry-modified from qtbase commit 2aef22b77aa15eb0863a9585af77ccab04425dbd) Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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 3a9d28b..fab9419 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -67,6 +67,11 @@ QCocoaWindow::QCocoaWindow(QWidget *tlw)
[m_nsWindow makeKeyAndOrderFront:nil];
[m_nsWindow setAcceptsMouseMovedEvents:YES];
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ if ([m_nsWindow respondsToSelector:@selector(setRestorable:)])
+ [m_nsWindow setRestorable: NO];
+#endif
}
QCocoaWindow::~QCocoaWindow()