Merge pull request #85100 from ztc0611/fix-ios-focus-mainloop-notifs

Enhance mobile suspend MainLoop notifications
This commit is contained in:
Rémi Verschelde 2024-02-14 14:07:54 +01:00
commit 3a2fb42838
No known key found for this signature in database
GPG key ID: C3336907360768E1
6 changed files with 57 additions and 10 deletions

View file

@ -324,11 +324,17 @@ void OS_Android::main_loop_end() {
void OS_Android::main_loop_focusout() {
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_OUT);
if (OS::get_singleton()->get_main_loop()) {
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT);
}
audio_driver_android.set_pause(true);
}
void OS_Android::main_loop_focusin() {
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_IN);
if (OS::get_singleton()->get_main_loop()) {
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_IN);
}
audio_driver_android.set_pause(false);
}