Removed SDL_uikitwindow

This was only needed as a workaround for buggy behavior in iOS 8
This commit is contained in:
Sam Lantinga
2025-10-31 09:33:35 -07:00
parent b46e26e65a
commit d97e8bd49b

View File

@@ -53,32 +53,6 @@
@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)
{
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, *)) {
UIWindowScene *scene = GetActiveWindowScene();
if (scene) {
uiwindow = [[SDL_uikitwindow alloc] initWithWindowScene:scene];
uiwindow = [[UIWindow alloc] initWithWindowScene:scene];
}
}
if (!uiwindow) {
// ignore the size user requested, and make a fullscreen window
#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
uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds];
uiwindow = [[UIWindow alloc] initWithFrame:data.uiscreen.bounds];
#endif
}