iOS 7 Bugs

Hi All,

It has been very exciting to follow the progress of SDL2 up to the actual release. But now, with iOS 7. Apple has managed to break my favourite piece of middleware. All of the issues below are iOS7 only.

  1. The status bar no longer goes away, but is instead transparently “on top” of the display. The status bar is not visible on iOS 6 or below.

  2. The game freezes when:

A. The menu is pulled down from the top of the screen
B. The menu is pulled up from the bottom of the screen
C. The iCloud popup appears

Going back to the home screen, and starting the game, activates it again.

Hope you can help,

Cheers,
Gorm

The game freezing when the notification or control centre windows are brought up is how all apps on the platform behave so I don’t think this is an issue. However, I do agree that the status bar always being on top is an issue.

I have just found a way to hide the status bar in iOS 7: http://stackoverflow.com/a/17946425

I have just found a way to hide the status bar in iOS 7: http://stackoverflow.com/a/17946425

I think the issue isn’t the app freezing, but rather failing to restart upon dismissal of the interruption. I’m not currently set up to develop on this thing to test, sadly. That’s next week’s project.

JosephSent from my iPhone

On Sep 27, 2013, at 17:16, “Eamonn” <eamonn.laffey at gmail.com> wrote:

The game freezing when the notification or control centre windows are brought up is how all apps on the platform behave so I don’t think this is an issue. However, I do agree that the status bar always being on top is an issue.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi Joseph,

Yes, precisely, the problem isn’t so much the freezing, but that the app isn’t restarting. I had hoped someone already knew a solution, but I’ll try to look into it as well.

Cheers,
Gorm----------------
Founder of @kotoristudios
Currently working on http://mulereturns.com

On Saturday, 28 September 2013 at 21:40, T. Joseph Carter wrote:

I think the issue isn’t the app freezing, but rather failing to restart upon dismissal of the interruption. I’m not currently set up to develop on this thing to test, sadly. That’s next week’s project.

Joseph
Sent from my iPhone

On Sep 27, 2013, at 17:16, “Eamonn” <eamonn.laffey at gmail.com (mailto:eamonn.laffey at gmail.com)> wrote:

The game freezing when the notification or control centre windows are brought up is how all apps on the platform behave so I don’t think this is an issue. However, I do agree that the status bar always being on top is an issue.


SDL mailing list
SDL at lists.libsdl.org (mailto:SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org (mailto:SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Check if you are properly resuming your application’s loops on SDL_APP_DIDENTERFOREGROUND, not on SDL_APP_WILLENTERFOREGROUND because the latter event does not get fired on notification center popup showing.

Hi yes, thank you for answer. I found this out just a few hours before your email in a different thread as well. This was indeed the bug.

For the status bar in iOS 7, there is no need to patch SDL. Just

'View controller-based status bar appearance" to NO in the plist and it disappears on its own :)On Wednesday, 2 October 2013 at 17:17, yezo wrote:

Check if you are properly resuming your application’s loops on SDL_APP_DIDENTERFOREGROUND, not on SDL_APP_WILLENTERFOREGROUND because the latter event does not get fired on notification center popup showing.


SDL mailing list
SDL at lists.libsdl.org (mailto:SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi, thank you for your work.
The “View controller-based status bar appearance” parameter was set to NO from the beginning in my project, and the status bar disappeared correctly when on the app start-up.
The problem was that the behavior of SDL is to show the status bar every time the application enters background, and hide it back when it resumes from background. So (in my case) the GL view was not of correct size and location after the status bar was hidden on resume, and this lead to the black gap in place of the hidden status bar - the screenshot is shown in my thread (https://forums.libsdl.org/viewtopic.php?t=9566). So my workaround was to comment the line that was showing the status bar on resume.

gormlai wrote:>

For the status bar in iOS 7, there is no need to patch SDL. Just

'View controller-based status bar appearance" to NO in the plist and it disappears on its own :slight_smile:

This should be fixed in the latest SDL code:

Cheers!On Sun, Oct 6, 2013 at 7:01 AM, yezo <e.zolotko at gmail.com> wrote:

**
Hi, thank you for your work.
The “View controller-based status bar appearance” parameter was set to NO
from the beginning in my project, and the status bar disappeared correctly
when on the app start-up.
The problem was that the behavior of SDL is to show the status bar every
time the application enters background, and hide it back when it resumes
from background. So (in my case) the GL view was not of correct size and
location after the status bar was hidden on resume, and this lead to the
black gap in place of the hidden status bar - the screenshot is shown in my
thread https://forums.libsdl.org/viewtopic.php?t=9566. So my workaround
was to comment the line that was showing the status bar on resume.

gormlai wrote:

For the status bar in iOS 7, there is no need to patch SDL. Just

'View controller-based status bar appearance" to NO in the plist and it
disappears on its own [image: Smile]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

This does not fix the issue due to:

if (data->uiscreen == [UIScreen mainScreen]) {
    if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
        [UIApplication sharedApplication].statusBarHidden = YES;
    } else {
        [UIApplication sharedApplication].statusBarHidden = NO;
    }
}

lines 174-180 in SDL_uikitwindow.m. This code takes the second path even with SDL_WINDOW_FULLSCREEN flag set because it is reset for some reason in:

window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);

line 1294 in SDL_video.c

Sam Lantinga wrote:> This should be fixed in the latest SDL code:http://hg.libsdl.org/SDL/rev/d20e37f08533 (http://hg.libsdl.org/SDL/rev/d20e37f08533)

Cheers!

On Sun, Oct 6, 2013 at 7:01 AM, yezo <e.zolotko at gmail.com (e.zolotko at gmail.com)> wrote:

   	Hi, thank you for your work.

The “View controller-based status bar appearance” parameter was set to NO from the beginning in my project, and the status bar disappeared correctly when on the app start-up.
The problem was that the behavior of SDL is to show the status bar every time the application enters background, and hide it back when it resumes from background. So (in my case) the GL view was not of correct size and location after the status bar was hidden on resume, and this lead to the black gap in place of the hidden status bar - the screenshot is shown in my thread (https://forums.libsdl.org/viewtopic.php?t=9566). So my workaround was to comment the line that was showing the status bar on resume.

gormlai wrote:

For the status bar in iOS 7, there is no need to patch SDL. Just

'View controller-based status bar appearance" to NO in the plist and it disappears on its own


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Apple broke some stuff, as usual…

You need to add something to your app plist as a quick fix, check here:

slimshader wrote:> This does not fix the issue due to:

if (data->uiscreen == [UIScreen mainScreen]) {
    if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
        [UIApplication sharedApplication].statusBarHidden = YES;
    } else {
        [UIApplication sharedApplication].statusBarHidden = NO;
    }
}

lines 174-180 in SDL_uikitwindow.m. This code takes the second path even with SDL_WINDOW_FULLSCREEN flag set because it is reset for some reason in:

window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);

line 1294 in SDL_video.c

Sam Lantinga wrote:

This should be fixed in the latest SDL code:http://hg.libsdl.org/SDL/rev/d20e37f08533 (http://hg.libsdl.org/SDL/rev/d20e37f08533)

Cheers!

On Sun, Oct 6, 2013 at 7:01 AM, yezo <e.zolotko at gmail.com (e.zolotko at gmail.com)> wrote:

   	Hi, thank you for your work.

The “View controller-based status bar appearance” parameter was set to NO from the beginning in my project, and the status bar disappeared correctly when on the app start-up.
The problem was that the behavior of SDL is to show the status bar every time the application enters background, and hide it back when it resumes from background. So (in my case) the GL view was not of correct size and location after the status bar was hidden on resume, and this lead to the black gap in place of the hidden status bar - the screenshot is shown in my thread (https://forums.libsdl.org/viewtopic.php?t=9566). So my workaround was to comment the line that was showing the status bar on resume.

gormlai wrote:

For the status bar in iOS 7, there is no need to patch SDL. Just

'View controller-based status bar appearance" to NO in the plist and it disappears on its own


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


Rodrigo Cardoso Rocha
@RodrigoRodrigoR - twitter.com/RodrigoRodrigoR
Chibata Creations - chibatacreations.com

This works for me, the code you mention does show the status bar, but
shortly thereafter calls

UIKit_SetWindowFullscreen()

which hides the status bar.

Showing and hiding the status bar for the application does nothing on iOS
7, but then when the OpenGL context is created, I get a call on the
SDL_uikitviewcontroller for “prefersStatusBarHidden”, which then returns
true and the status bar is hidden.

Are you overriding the view controller or creating the OpenGL context
yourself somehow?On Tue, Oct 22, 2013 at 7:26 AM, slimshader <szymon.gatner at gmail.com> wrote:

**
This does not fix the issue due to:

if (data->uiscreen == [UIScreen mainScreen]) {
if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
[UIApplication sharedApplication].statusBarHidden = YES;
} else {
[UIApplication sharedApplication].statusBarHidden = NO;
}
}

lines 174-180 in SDL_uikitwindow.m. This code takes the second path even
with SDL_WINDOW_FULLSCREEN flag set because it is reset for some reason in:

window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);

line 1294 in SDL_video.c

Sam Lantinga wrote:

This should be fixed in the latest SDL code:
http://hg.libsdl.org/SDL/rev/d20e37f08533

Cheers!

On Sun, Oct 6, 2013 at 7:01 AM, yezo <> wrote:

Quote:

Hi, thank you for your work.
The “View controller-based status bar appearance” parameter was set to NO
from the beginning in my project, and the status bar disappeared correctly
when on the app start-up.
The problem was that the behavior of SDL is to show the status bar every
time the application enters background, and hide it back when it resumes
from background. So (in my case) the GL view was not of correct size and
location after the status bar was hidden on resume, and this lead to the
black gap in place of the hidden status bar - the screenshot is shown in my
thread https://forums.libsdl.org/viewtopic.php?t=9566. So my workaround
was to comment the line that was showing the status bar on resume.

gormlai wrote:

For the status bar in iOS 7, there is no need to patch SDL. Just

'View controller-based status bar appearance" to NO in the plist and it
disappears on its own


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org