Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee91470

Browse filesBrowse files
authored
Merge pull request #27683 from meeseeksmachine/auto-backport-of-pr-27670-on-v3.8.x
Backport PR #27670 on branch v3.8.x (Implement macos AppDelegate)
2 parents 6755d50 + a9ff1e7 commit ee91470
Copy full SHA for ee91470

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎src/_macosx.m

Copy file name to clipboardExpand all lines: src/_macosx.m
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ static int wait_for_stdin() {
100100
}
101101

102102
/* ---------------------------- Cocoa classes ---------------------------- */
103+
@interface MatplotlibAppDelegate : NSObject <NSApplicationDelegate>
104+
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app;
105+
@end
103106

104107
@interface Window : NSWindow
105108
{ PyObject* manager;
@@ -195,6 +198,7 @@ static void lazy_init(void) {
195198

196199
NSApp = [NSApplication sharedApplication];
197200
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
201+
[NSApp setDelegate: [[[MatplotlibAppDelegate alloc] init] autorelease]];
198202

199203
// Run our own event loop while waiting for stdin on the Python side
200204
// this is needed to keep the application responsive while waiting for input
@@ -779,6 +783,12 @@ int mpl_check_modifier(
779783
},
780784
};
781785

786+
@implementation MatplotlibAppDelegate
787+
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app {
788+
return YES;
789+
}
790+
@end
791+
782792
@interface NavigationToolbar2Handler : NSObject
783793
{ PyObject* toolbar;
784794
NSButton* panbutton;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.