diff options
author | Liang Qi <liang.qi@digia.com> | 2013-08-06 05:34:45 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-11 12:30:21 (GMT) |
commit | f7efbae117595c2503ca85bfca7f27e0b6a92328 (patch) | |
tree | 761c46d37da54fc97d9cfc2a9e972cdfc08a5ef4 /src | |
parent | 4a2c688e2a0542e450a6405a74cda4762555af4f (diff) | |
download | Qt-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')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 5 |
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() |