Fixed the status bar visibility in iOS 7
authorSam Lantinga <slouken@libsdl.org>
Sun, 20 Oct 2013 23:05:53 -0700
changeset 7862 d20e37f08533
parent 7861 29d012c8f2a9
child 7863 c6b33210e610
Fixed the status bar visibility in iOS 7
src/video/uikit/SDL_uikitviewcontroller.h
src/video/uikit/SDL_uikitviewcontroller.m
src/video/uikit/SDL_uikitwindow.m
--- a/src/video/uikit/SDL_uikitviewcontroller.h	Sun Oct 20 22:23:09 2013 -0700
+++ b/src/video/uikit/SDL_uikitviewcontroller.h	Sun Oct 20 23:05:53 2013 -0700
@@ -35,5 +35,6 @@
 - (void)viewDidLayoutSubviews;
 - (NSUInteger)supportedInterfaceOrientations;
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient;
+- (BOOL)prefersStatusBarHidden;
 
 @end
--- a/src/video/uikit/SDL_uikitviewcontroller.m	Sun Oct 20 22:23:09 2013 -0700
+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Sun Oct 20 23:05:53 2013 -0700
@@ -119,6 +119,15 @@
     return (orientationMask & (1 << orient));
 }
 
+- (BOOL)prefersStatusBarHidden
+{
+    if (self->window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
+        return YES;
+    } else {
+        return NO;
+    }
+}
+
 @end
 
 #endif /* SDL_VIDEO_DRIVER_UIKIT */
--- a/src/video/uikit/SDL_uikitwindow.m	Sun Oct 20 22:23:09 2013 -0700
+++ b/src/video/uikit/SDL_uikitwindow.m	Sun Oct 20 23:05:53 2013 -0700
@@ -99,11 +99,13 @@
     if (displaydata->uiscreen == [UIScreen mainScreen]) {
         window->flags |= SDL_WINDOW_INPUT_FOCUS;  /* always has input focus */
 
+        /* This was setup earlier for our window, and in iOS 7 is controlled by the view, not the application
         if ([UIApplication sharedApplication].statusBarHidden) {
             window->flags |= SDL_WINDOW_BORDERLESS;
         } else {
             window->flags &= ~SDL_WINDOW_BORDERLESS;
         }
+        */
     } else {
         window->flags &= ~SDL_WINDOW_RESIZABLE;  /* window is NEVER resizeable */
         window->flags &= ~SDL_WINDOW_INPUT_FOCUS;  /* never has input focus */