|
|
@@ -163,10 +163,17 @@ bool UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
|
|
|
}
|
|
|
|
|
|
if (data.uiscreen == [UIScreen mainScreen]) {
|
|
|
- if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) {
|
|
|
- [UIApplication sharedApplication].statusBarHidden = YES;
|
|
|
+ if (@available(iOS 13.0, *)) {
|
|
|
+ // iOS 13+ uses view controller's prefersStatusBarHidden
|
|
|
} else {
|
|
|
- [UIApplication sharedApplication].statusBarHidden = NO;
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
+ if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) {
|
|
|
+ [UIApplication sharedApplication].statusBarHidden = YES;
|
|
|
+ } else {
|
|
|
+ [UIApplication sharedApplication].statusBarHidden = NO;
|
|
|
+ }
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
}
|
|
|
#endif // !SDL_PLATFORM_TVOS
|
|
|
@@ -193,7 +200,14 @@ bool UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
|
|
|
// put the window on an external display if appropriate.
|
|
|
#ifndef SDL_PLATFORM_VISIONOS
|
|
|
if (data.uiscreen != [UIScreen mainScreen]) {
|
|
|
- [uiwindow setScreen:data.uiscreen];
|
|
|
+ if (@available(iOS 13.0, tvOS 13.0, *)) {
|
|
|
+ // iOS 13+ uses UIWindowScene to manage screen association
|
|
|
+ } else {
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
+ [uiwindow setScreen:data.uiscreen];
|
|
|
+#pragma clang diagnostic pop
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
@@ -277,10 +291,17 @@ static void UIKit_UpdateWindowBorder(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
#if !defined(SDL_PLATFORM_TVOS) && !defined(SDL_PLATFORM_VISIONOS)
|
|
|
if (data.uiwindow.screen == [UIScreen mainScreen]) {
|
|
|
- if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) {
|
|
|
- [UIApplication sharedApplication].statusBarHidden = YES;
|
|
|
+ if (@available(iOS 13.0, *)) {
|
|
|
+ // iOS 13+ uses view controller's prefersStatusBarHidden
|
|
|
} else {
|
|
|
- [UIApplication sharedApplication].statusBarHidden = NO;
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
+ if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) {
|
|
|
+ [UIApplication sharedApplication].statusBarHidden = YES;
|
|
|
+ } else {
|
|
|
+ [UIApplication sharedApplication].statusBarHidden = NO;
|
|
|
+ }
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
|
|
|
[viewcontroller setNeedsStatusBarAppearanceUpdate];
|