1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Enhance mobile suspend MainLoop Notifications

This commit is contained in:
Zach Coleman
2023-11-17 08:23:06 -05:00
parent b4e2a24c1f
commit fc7a63cbf3
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);
}