Commit b4d15ece6d82c6de9026e6d1837aa221231834c7

Alex Szpakowski 2014-07-16T16:12:20

Fixed SDL_SetWindowFullscreen not properly updating the status bar visibility in iOS 7+

diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m
index 8c34835..78f0c21 100644
--- a/src/video/uikit/SDL_uikitwindow.m
+++ b/src/video/uikit/SDL_uikitwindow.m
@@ -241,7 +241,9 @@ void
 UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
 {
     SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
-    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
+    SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata;
+    SDL_uikitviewcontroller *viewcontroller = windowdata->viewcontroller;
+    UIWindow *uiwindow = windowdata->uiwindow;
 
     if (fullscreen) {
         [UIApplication sharedApplication].statusBarHidden = YES;
@@ -249,6 +251,12 @@ UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display
         [UIApplication sharedApplication].statusBarHidden = NO;
     }
 
+#ifdef __IPHONE_7_0
+    if ([viewcontroller respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
+        [viewcontroller setNeedsStatusBarAppearanceUpdate];
+    }
+#endif
+
     CGRect bounds;
     if (fullscreen) {
         bounds = [displaydata->uiscreen bounds];