Removed SDL_uikitwindow
This was only needed as a workaround for buggy behavior in iOS 8
This commit is contained in:
@@ -53,32 +53,6 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface SDL_uikitwindow : UIWindow
|
|
||||||
|
|
||||||
- (void)layoutSubviews;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation SDL_uikitwindow
|
|
||||||
|
|
||||||
- (void)layoutSubviews
|
|
||||||
{
|
|
||||||
#ifndef SDL_PLATFORM_VISIONOS
|
|
||||||
// Workaround to fix window orientation issues in iOS 8.
|
|
||||||
/* As of July 1 2019, I haven't been able to reproduce any orientation
|
|
||||||
* issues with this disabled on iOS 12. The issue this is meant to fix might
|
|
||||||
* only happen on iOS 8, or it might have been fixed another way with other
|
|
||||||
* code... This code prevents split view (iOS 9+) from working on iPads, so
|
|
||||||
* we want to avoid using it if possible. */
|
|
||||||
if (!UIKit_IsSystemVersionAtLeast(9.0)) {
|
|
||||||
self.frame = self.screen.bounds;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
[super layoutSubviews];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
static bool SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow *uiwindow, bool created)
|
static bool SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow *uiwindow, bool created)
|
||||||
{
|
{
|
||||||
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
|
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
|
||||||
@@ -238,15 +212,15 @@ bool UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
|
|||||||
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
||||||
UIWindowScene *scene = GetActiveWindowScene();
|
UIWindowScene *scene = GetActiveWindowScene();
|
||||||
if (scene) {
|
if (scene) {
|
||||||
uiwindow = [[SDL_uikitwindow alloc] initWithWindowScene:scene];
|
uiwindow = [[UIWindow alloc] initWithWindowScene:scene];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!uiwindow) {
|
if (!uiwindow) {
|
||||||
// ignore the size user requested, and make a fullscreen window
|
// ignore the size user requested, and make a fullscreen window
|
||||||
#ifdef SDL_PLATFORM_VISIONOS
|
#ifdef SDL_PLATFORM_VISIONOS
|
||||||
uiwindow = [[SDL_uikitwindow alloc] initWithFrame:CGRectMake(0, 0, SDL_XR_SCREENWIDTH, SDL_XR_SCREENHEIGHT)];
|
uiwindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, SDL_XR_SCREENWIDTH, SDL_XR_SCREENHEIGHT)];
|
||||||
#else
|
#else
|
||||||
uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds];
|
uiwindow = [[UIWindow alloc] initWithFrame:data.uiscreen.bounds];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user