Skip to content

Commit

Permalink
Fixed the status bar visibility in iOS 7
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 21, 2013
1 parent 85c2e23 commit f8c11bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/uikit/SDL_uikitviewcontroller.h
Expand Up @@ -35,5 +35,6 @@
- (void)viewDidLayoutSubviews;
- (NSUInteger)supportedInterfaceOrientations;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient;
- (BOOL)prefersStatusBarHidden;

@end
9 changes: 9 additions & 0 deletions src/video/uikit/SDL_uikitviewcontroller.m
Expand Up @@ -119,6 +119,15 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient
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 */
Expand Down
2 changes: 2 additions & 0 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -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 */
Expand Down

0 comments on commit f8c11bb

Please sign in to comment.