Fixed SDL_SetWindowFullscreen not properly updating the status bar visibility in iOS 7+ iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Wed, 16 Jul 2014 16:12:20 -0300
branchiOS-improvements
changeset 9491 c652f2655d2a
parent 9490 9eab796ea0b8
child 9492 cad5a9995bde
Fixed SDL_SetWindowFullscreen not properly updating the status bar visibility in iOS 7+
src/video/uikit/SDL_uikitwindow.m
--- a/src/video/uikit/SDL_uikitwindow.m	Tue Jul 15 02:04:08 2014 -0300
+++ b/src/video/uikit/SDL_uikitwindow.m	Wed Jul 16 16:12:20 2014 -0300
@@ -241,7 +241,9 @@
 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 @@
         [UIApplication sharedApplication].statusBarHidden = NO;
     }
 
+#ifdef __IPHONE_7_0
+    if ([viewcontroller respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
+        [viewcontroller setNeedsStatusBarAppearanceUpdate];
+    }
+#endif
+
     CGRect bounds;
     if (fullscreen) {
         bounds = [displaydata->uiscreen bounds];