Fixed messageboxes when using window scenes on Apple platforms
This commit is contained in:
@@ -98,11 +98,19 @@ static BOOL UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messag
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (window == nil || window.rootViewController == nil) {
|
if (window == nil || window.rootViewController == nil) {
|
||||||
|
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
||||||
|
UIWindowScene *scene = UIKit_GetActiveWindowScene();
|
||||||
|
if (scene) {
|
||||||
|
alertwindow = [[UIWindow alloc] initWithWindowScene:scene];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!alertwindow) {
|
||||||
#ifdef SDL_PLATFORM_VISIONOS
|
#ifdef SDL_PLATFORM_VISIONOS
|
||||||
alertwindow = [[UIWindow alloc] init];
|
alertwindow = [[UIWindow alloc] init];
|
||||||
#else
|
#else
|
||||||
alertwindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
alertwindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
alertwindow.rootViewController = [UIViewController new];
|
alertwindow.rootViewController = [UIViewController new];
|
||||||
alertwindow.windowLevel = UIWindowLevelAlert;
|
alertwindow.windowLevel = UIWindowLevelAlert;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user