diff --git a/src/_macosx.m b/src/_macosx.m index ac9009965b4f..8038b72899df 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -100,6 +100,9 @@ static int wait_for_stdin() { } /* ---------------------------- Cocoa classes ---------------------------- */ +@interface MatplotlibAppDelegate : NSObject +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app; +@end @interface Window : NSWindow { PyObject* manager; @@ -195,6 +198,7 @@ static void lazy_init(void) { NSApp = [NSApplication sharedApplication]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + [NSApp setDelegate: [[[MatplotlibAppDelegate alloc] init] autorelease]]; // Run our own event loop while waiting for stdin on the Python side // this is needed to keep the application responsive while waiting for input @@ -779,6 +783,12 @@ int mpl_check_modifier( }, }; +@implementation MatplotlibAppDelegate +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app { + return YES; +} +@end + @interface NavigationToolbar2Handler : NSObject { PyObject* toolbar; NSButton* panbutton;