Removed an ugly hack to make windows rotate properly on iOS 8+. Recent commits apparently resolved the issue that made the hack necessary.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/src/video/uikit/SDL_uikitwindow.h b/src/video/uikit/SDL_uikitwindow.h
index c279d0f..fd91b56 100644
--- a/src/video/uikit/SDL_uikitwindow.h
+++ b/src/video/uikit/SDL_uikitwindow.h
@@ -40,13 +40,9 @@ extern NSUInteger UIKit_GetSupportedOrientations(SDL_Window * window);
@class UIWindow;
-@interface SDL_uikitwindow : UIWindow
-
-@end
-
@interface SDL_WindowData : NSObject
-@property (nonatomic, strong) SDL_uikitwindow *uiwindow;
+@property (nonatomic, strong) UIWindow *uiwindow;
@property (nonatomic, strong) SDL_uikitopenglview *view;
@property (nonatomic, strong) SDL_uikitviewcontroller *viewcontroller;
diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m
index 0c2f120..d1e32b2 100644
--- a/src/video/uikit/SDL_uikitwindow.m
+++ b/src/video/uikit/SDL_uikitwindow.m
@@ -41,21 +41,6 @@
#include <Foundation/Foundation.h>
-@implementation SDL_uikitwindow
-
-- (void)layoutSubviews
-{
- [super layoutSubviews];
-
- /* This seems to be needed on iOS 8, otherwise the window's frame is put in
- * an unexpected position when the screen or device is rotated.
- * FIXME: is there a better solution to that problem than this ugly hack?
- */
- self.frame = self.screen.bounds;
-}
-
-@end
-
@implementation SDL_WindowData
@synthesize uiwindow;
@@ -65,7 +50,7 @@
@end
-static int SetupWindowData(_THIS, SDL_Window *window, SDL_uikitwindow *uiwindow, SDL_bool created)
+static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created)
{
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
@@ -213,7 +198,7 @@ UIKit_CreateWindow(_THIS, SDL_Window *window)
/* ignore the size user requested, and make a fullscreen window */
/* !!! FIXME: can we have a smaller view? */
- SDL_uikitwindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds];
+ UIWindow *uiwindow = [[UIWindow alloc] initWithFrame:data.uiscreen.bounds];
/* put the window on an external display if appropriate. This implicitly
* does [uiwindow setframe:[uiscreen bounds]], so don't do it on the