Removed an ugly hack to make windows rotate properly on iOS 8+. iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Sun, 23 Nov 2014 23:29:24 -0400
branchiOS-improvements
changeset 95286915f7db6791
parent 9527 bbd9326ecacf
child 9529 4bf9830d8153
Removed an ugly hack to make windows rotate properly on iOS 8+.
Recent commits apparently resolved the issue that made the hack necessary.
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/src/video/uikit/SDL_uikitwindow.h	Sun Nov 23 23:23:47 2014 -0400
     1.2 +++ b/src/video/uikit/SDL_uikitwindow.h	Sun Nov 23 23:29:24 2014 -0400
     1.3 @@ -40,13 +40,9 @@
     1.4  
     1.5  @class UIWindow;
     1.6  
     1.7 -@interface SDL_uikitwindow : UIWindow
     1.8 -
     1.9 -@end
    1.10 -
    1.11  @interface SDL_WindowData : NSObject
    1.12  
    1.13 -@property (nonatomic, strong) SDL_uikitwindow *uiwindow;
    1.14 +@property (nonatomic, strong) UIWindow *uiwindow;
    1.15  @property (nonatomic, strong) SDL_uikitopenglview *view;
    1.16  @property (nonatomic, strong) SDL_uikitviewcontroller *viewcontroller;
    1.17  
     2.1 --- a/src/video/uikit/SDL_uikitwindow.m	Sun Nov 23 23:23:47 2014 -0400
     2.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Sun Nov 23 23:29:24 2014 -0400
     2.3 @@ -41,21 +41,6 @@
     2.4  
     2.5  #include <Foundation/Foundation.h>
     2.6  
     2.7 -@implementation SDL_uikitwindow
     2.8 -
     2.9 -- (void)layoutSubviews
    2.10 -{
    2.11 -    [super layoutSubviews];
    2.12 -
    2.13 -    /* This seems to be needed on iOS 8, otherwise the window's frame is put in
    2.14 -     * an unexpected position when the screen or device is rotated.
    2.15 -     * FIXME: is there a better solution to that problem than this ugly hack?
    2.16 -     */
    2.17 -    self.frame = self.screen.bounds;
    2.18 -}
    2.19 -
    2.20 -@end
    2.21 -
    2.22  @implementation SDL_WindowData
    2.23  
    2.24  @synthesize uiwindow;
    2.25 @@ -65,7 +50,7 @@
    2.26  @end
    2.27  
    2.28  
    2.29 -static int SetupWindowData(_THIS, SDL_Window *window, SDL_uikitwindow *uiwindow, SDL_bool created)
    2.30 +static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created)
    2.31  {
    2.32      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    2.33      SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
    2.34 @@ -213,7 +198,7 @@
    2.35  
    2.36          /* ignore the size user requested, and make a fullscreen window */
    2.37          /* !!! FIXME: can we have a smaller view? */
    2.38 -        SDL_uikitwindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds];
    2.39 +        UIWindow *uiwindow = [[UIWindow alloc] initWithFrame:data.uiscreen.bounds];
    2.40  
    2.41          /* put the window on an external display if appropriate. This implicitly
    2.42           * does [uiwindow setframe:[uiscreen bounds]], so don't do it on the