diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-11 16:34:32 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-11 16:42:31 -0300 |
commit | b7d69c2444354e526e4112d9c65423e9fd311f27 (patch) | |
tree | 42249b9c4928059efd074ab886b5ef36dc947563 /platform/android | |
parent | 7bf4b592f806caeb9112d026bc650889e509e930 (diff) |
Added a BACK notification besides QUIT, so they go in separate channels.
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 2 | ||||
-rw-r--r-- | platform/android/java_glue.cpp | 15 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 4 | ||||
-rw-r--r-- | platform/android/os_android.h | 2 |
4 files changed, 11 insertions, 12 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index d2533378dc..94d29a3350 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -721,7 +721,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC @Override public void onBackPressed() { System.out.printf("** BACK REQUEST!\n"); - GodotLib.quit(); + GodotLib.back(); } public void forceQuit() { diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 63d53e35a3..a691e60575 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -649,7 +649,7 @@ static Mutex *suspend_mutex=NULL; static int step=0; static bool resized=false; static bool resized_reload=false; -static bool quit_request=false; +static bool go_back_request=false; static Size2 new_size; static Vector3 accelerometer; static Vector3 magnetometer; @@ -965,11 +965,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv * e } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_quit(JNIEnv * env, jobject obj) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv * env, jobject obj) { input_mutex->lock(); - quit_request=true; - print_line("BACK PRESSED"); + go_back_request=true; input_mutex->unlock(); } @@ -1096,10 +1095,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jo joy_events.pop_front(); } - if (quit_request) { + if (go_back_request) { - os_android->main_loop_request_quit(); - quit_request=false; + os_android->main_loop_request_go_back(); + go_back_request=false; } @@ -1494,7 +1493,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv * env, job ievent.key.unicode = KEY_ENTER; } else if (p_scancode==4) { - quit_request=true; + go_back_request=true; } input_mutex->lock(); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index e625c0d7ec..55fe3f21a0 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -659,10 +659,10 @@ void OS_Android::init_video_mode(int p_video_width,int p_video_height) { default_videomode.resizable=false; } -void OS_Android::main_loop_request_quit() { +void OS_Android::main_loop_request_go_back() { if (main_loop) - main_loop->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST); + main_loop->notification(MainLoop::NOTIFICATION_WM_GO_BACK_REQUEST); } void OS_Android::set_display_size(Size2 p_size) { diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 5e1fc10fd6..9ed7ba5fac 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -213,7 +213,7 @@ public: void main_loop_begin(); bool main_loop_iterate(); - void main_loop_request_quit(); + void main_loop_request_go_back(); void main_loop_end(); void main_loop_focusout(); void main_loop_focusin(); |