From d97e8bd49bdc154aacb4aa9ce092754f86162a20 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 31 Oct 2025 09:33:35 -0700
Subject: [PATCH] Removed SDL_uikitwindow
This was only needed as a workaround for buggy behavior in iOS 8
---
src/video/uikit/SDL_uikitwindow.m | 32 +++----------------------------
1 file changed, 3 insertions(+), 29 deletions(-)
diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m
index 5fa0a3173c5ed..c1aa41e5d977f 100644
--- a/src/video/uikit/SDL_uikitwindow.m
+++ b/src/video/uikit/SDL_uikitwindow.m
@@ -53,32 +53,6 @@ - (instancetype)init
@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
}