Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 11 additions & 4 deletions packages/react-native/React/CoreModules/RCTDevLoadingView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

using namespace facebook::react;

static NSString *sRCTDevLoadingViewWindowIdentifier = @"RCTDevLoadingViewWindow";

@interface RCTDevLoadingView () <NativeDevLoadingViewSpec>
@end

Expand Down Expand Up @@ -121,16 +123,17 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo

self->_showDate = [NSDate date];

RCTPlatformWindow *mainWindow = RCTKeyWindow(); // [macOS]
#if !TARGET_OS_OSX // [macOS]
UIWindow *mainWindow = RCTKeyWindow();
self->_window = [[UIWindow alloc] initWithWindowScene:mainWindow.windowScene];
self->_window.windowLevel = UIWindowLevelStatusBar + 1;
self->_window.rootViewController = [UIViewController new];
#else // [macOS
self->_window = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20)
self->_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20)
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
[self->_window setIdentifier:sRCTDevLoadingViewWindowIdentifier];
#endif // macOS]

self->_container = [[RCTUIView alloc] init]; // [macOS]
Expand Down Expand Up @@ -220,7 +223,11 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
self->_hiding = false;
}];
#else // [macOS]
[RCTKeyWindow() endSheet:self->_window];
for (NSWindow *window in [RCTKeyWindow() sheets]) {
if ([[window identifier] isEqualToString:sRCTDevLoadingViewWindowIdentifier]) {
[RCTKeyWindow() endSheet:window];
}
}
self->_window = nil;
self->_hiding = false;
#endif // macOS]
Expand Down Expand Up @@ -350,4 +357,4 @@ - (void)hide
Class RCTDevLoadingViewCls(void)
{
return RCTDevLoadingView.class;
}
}
2 changes: 1 addition & 1 deletion packages/rn-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"e2e-test-ios": "./scripts/maestro-test-ios.sh"
},
"dependencies": {
"@react-native/oss-library-example": "0.78.3",
"@react-native/oss-library-example": "workspace:*",
"@react-native/popup-menu-android": "workspace:*",
"flow-enums-runtime": "^0.0.6",
"invariant": "^2.2.4",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,7 @@ __metadata:
languageName: unknown
linkType: soft

"@react-native-mac/virtualized-lists@npm:0.77.3, @react-native-mac/virtualized-lists@workspace:packages/virtualized-lists":
"@react-native-mac/virtualized-lists@npm:0.78.2, @react-native-mac/virtualized-lists@workspace:packages/virtualized-lists":
version: 0.0.0-use.local
resolution: "@react-native-mac/virtualized-lists@workspace:packages/virtualized-lists"
dependencies:
Expand Down Expand Up @@ -3060,7 +3060,7 @@ __metadata:
languageName: unknown
linkType: soft

"@react-native/oss-library-example@npm:0.78.3, @react-native/oss-library-example@workspace:packages/react-native-test-library":
"@react-native/oss-library-example@workspace:*, @react-native/oss-library-example@workspace:packages/react-native-test-library":
version: 0.0.0-use.local
resolution: "@react-native/oss-library-example@workspace:packages/react-native-test-library"
dependencies:
Expand Down Expand Up @@ -3096,7 +3096,7 @@ __metadata:
"@react-native-community/cli": "npm:15.0.0-alpha.2"
"@react-native-community/cli-platform-android": "npm:15.0.0-alpha.2"
"@react-native-community/cli-platform-ios": "npm:15.0.0-alpha.2"
"@react-native/oss-library-example": "npm:0.78.3"
"@react-native/oss-library-example": "workspace:*"
"@react-native/popup-menu-android": "workspace:*"
flow-enums-runtime: "npm:^0.0.6"
invariant: "npm:^2.2.4"
Expand Down Expand Up @@ -10865,7 +10865,7 @@ __metadata:
resolution: "react-native-macos@workspace:packages/react-native"
dependencies:
"@jest/create-cache-key-function": "npm:^29.6.3"
"@react-native-mac/virtualized-lists": "npm:0.77.3"
"@react-native-mac/virtualized-lists": "npm:0.78.2"
"@react-native/assets-registry": "npm:0.78.1"
"@react-native/codegen": "npm:0.78.1"
"@react-native/community-cli-plugin": "npm:0.78.1"
Expand Down