Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

using namespace facebook::react;

#if TARGET_OS_OSX // [macOS
static NSString *sRCTAppDelegateMainWindowFrameAutoSaveName = @"RCTAppDelegateMainWindow";
#endif // macOS]

@implementation RCTAppDelegate

- (instancetype)init
Expand Down Expand Up @@ -92,7 +96,10 @@ - (void)loadReactNativeWindow:(NSDictionary *)launchOptions
rootView.frame = frame;
self.window.contentViewController = rootViewController;
[self.window makeKeyAndOrderFront:self];
[self.window center];
if (![self.window setFrameUsingName:sRCTAppDelegateMainWindowFrameAutoSaveName]) {
[self.window center];
}
[self.window setFrameAutosaveName:sRCTAppDelegateMainWindowFrameAutoSaveName];
#endif // macOS]
}

Expand Down Expand Up @@ -132,4 +139,4 @@ - (void)setBridgeAdapter:(RCTSurfacePresenterBridgeAdapter *)bridgeAdapter
self.reactNativeFactory.rootViewFactory.bridgeAdapter = bridgeAdapter;
}

@end
@end
Loading