diff options
| author | Ruslan Mustakov | 2018-05-11 17:07:43 +0700 |
|---|---|---|
| committer | Ruslan Mustakov | 2018-05-11 17:19:39 +0700 |
| commit | 08a924bcee3b4d128ddcf261a8c2fc915db486fc (patch) | |
| tree | 58ed5cf70b822353f1ec158bfc8783688a14519c /platform | |
| parent | 74796d9b6cf1663029a5fa6b5024b236746e506a (diff) | |
| download | godot-08a924bcee3b4d128ddcf261a8c2fc915db486fc.tar.gz godot-08a924bcee3b4d128ddcf261a8c2fc915db486fc.tar.zst godot-08a924bcee3b4d128ddcf261a8c2fc915db486fc.zip | |
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/iphone/app_delegate.mm | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 7ed1328b2..dd5ce4ab1 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -709,21 +709,18 @@ static int frame_count = 0; iphone_finish(); }; -- (void)applicationDidEnterBackground:(UIApplication *)application { - ///@TODO maybe add pause motionManager? and where would we unpause it? +// When application goes to background (e.g. user switches to another app or presses Home), +// then applicationWillResignActive -> applicationDidEnterBackground are called. +// When user opens the inactive app again, +// applicationWillEnterForeground -> applicationDidBecomeActive are called. - on_focus_out(view_controller, &is_focus_out); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); - [view_controller.view startAnimation]; -} +// There are cases when applicationWillResignActive -> applicationDidBecomeActive +// sequence is called without the app going to background. For example, that happens +// if you open the app list without switching to another app or open/close the +// notification panel by swiping from the upper part of the screen. - (void)applicationWillResignActive:(UIApplication *)application { - // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT); - [view_controller.view - stopAnimation]; // FIXME: pause seems to be recommended elsewhere + on_focus_out(view_controller, &is_focus_out); } - (void)applicationDidBecomeActive:(UIApplication *)application { |
