From 027887da159055a82b88034edc70138c62488772 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 1 Jul 2019 14:52:56 -0300 Subject: [PATCH] iOS: Fix the window size not being set properly when Split View is used on an iPad (bug #4586). --- src/video/uikit/SDL_uikitwindow.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 915a4dd9087f7..4561223833102 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -69,8 +69,15 @@ @implementation SDL_uikitwindow - (void)layoutSubviews { - /* Workaround to fix window orientation issues in iOS 8+. */ - self.frame = self.screen.bounds; + /* 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; + } [super layoutSubviews]; }