From f8c11bb955e3c547f098ad16efa739283ce4d106 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 20 Oct 2013 23:05:53 -0700 Subject: [PATCH] Fixed the status bar visibility in iOS 7 --- src/video/uikit/SDL_uikitviewcontroller.h | 1 + src/video/uikit/SDL_uikitviewcontroller.m | 9 +++++++++ src/video/uikit/SDL_uikitwindow.m | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h index 2bc664d6c..a69c1e117 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.h +++ b/src/video/uikit/SDL_uikitviewcontroller.h @@ -35,5 +35,6 @@ - (void)viewDidLayoutSubviews; - (NSUInteger)supportedInterfaceOrientations; - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient; +- (BOOL)prefersStatusBarHidden; @end diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 157b70aa0..077c160da 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -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 */ diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index b3f7ac9f4..a8b8e6772 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -99,11 +99,13 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo 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 */