Disable the SDL event pump after the SDL main routine returns, since events will be dispatched by the Cocoa event loop.
1.1 --- a/include/SDL_system.h Sat Jun 23 06:46:06 2012 -0400
1.2 +++ b/include/SDL_system.h Mon Jun 25 11:10:34 2012 -0400
1.3 @@ -43,6 +43,7 @@
1.4 #include "SDL_video.h"
1.5
1.6 extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
1.7 +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
1.8
1.9 extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardShow(SDL_Window * window);
1.10 extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardHide(SDL_Window * window);
2.1 --- a/src/video/uikit/SDL_uikitappdelegate.m Sat Jun 23 06:46:06 2012 -0400
2.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m Mon Jun 25 11:10:34 2012 -0400
2.3 @@ -26,6 +26,7 @@
2.4 #import "SDL_assert.h"
2.5 #import "SDL_hints.h"
2.6 #import "../../SDL_hints_c.h"
2.7 +#import "SDL_system.h"
2.8
2.9 #import "SDL_uikitappdelegate.h"
2.10 #import "SDL_uikitopenglview.h"
2.11 @@ -105,7 +106,9 @@
2.12 SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);
2.13
2.14 /* run the user's application, passing argc and argv */
2.15 + SDL_iPhoneSetEventPump(SDL_TRUE);
2.16 exit_status = SDL_main(forward_argc, forward_argv);
2.17 + SDL_iPhoneSetEventPump(SDL_FALSE);
2.18
2.19 /* exit, passing the return status from the user's application */
2.20 // We don't actually exit to support applications that do setup in
3.1 --- a/src/video/uikit/SDL_uikitevents.m Sat Jun 23 06:46:06 2012 -0400
3.2 +++ b/src/video/uikit/SDL_uikitevents.m Mon Jun 25 11:10:34 2012 -0400
3.3 @@ -30,9 +30,20 @@
3.4 #import <Foundation/Foundation.h>
3.5 #include "jumphack.h"
3.6
3.7 +static BOOL UIKit_EventPumpEnabled = YES;
3.8 +
3.9 +void
3.10 +SDL_iPhoneSetEventPump(SDL_bool enabled)
3.11 +{
3.12 + UIKit_EventPumpEnabled = enabled;
3.13 +}
3.14 +
3.15 void
3.16 UIKit_PumpEvents(_THIS)
3.17 {
3.18 + if (!UIKit_EventPumpEnabled)
3.19 + return;
3.20 +
3.21 /*
3.22 When the user presses the 'home' button on the iPod
3.23 the application exits -- immediatly.