summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Becker <sylvain.becker@gmail.com>2019-01-06 20:25:54 +0100
committerSylvain Becker <sylvain.becker@gmail.com>2019-01-06 20:25:54 +0100
commite893a26dfc86389397003efbcc190aca9d9afe34 (patch)
treedabedf9ee0f6b447cda9607e292315c0ff6cb3e6
parentb8c006b0b80844790e684501bf3ed141132e586c (diff)
Android: better fix for bug 3186. Run those commands from SDL thread.
-rw-r--r--src/core/android/SDL_android.c7
-rw-r--r--src/video/android/SDL_androidevents.c12
2 files changed, 12 insertions, 7 deletions
diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 1cebed3996..b9b9b3be92 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -838,13 +838,6 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)(
__android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
if (Android_Window) {
-
- /* Make sure SW Keyboard is restored when an app becomes foreground */
- if (SDL_IsTextInputActive()) {
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
- Android_StartTextInput(_this); /* Only showTextInput */
- }
-
SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c
index 0e3bb01bc9..776d300c0b 100644
--- a/src/video/android/SDL_androidevents.c
+++ b/src/video/android/SDL_androidevents.c
@@ -107,6 +107,12 @@ Android_PumpEvents(_THIS)
android_egl_context_restore(Android_Window);
SDL_UnlockMutex(Android_ActivityMutex);
}
+
+ /* Make sure SW Keyboard is restored when an app becomes foreground */
+ if (SDL_IsTextInputActive()) {
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ Android_StartTextInput(_this); /* Only showTextInput */
+ }
}
} else {
if (isPausing || SDL_SemTryWait(Android_PauseSem) == 0) {
@@ -144,6 +150,12 @@ Android_PumpEvents(_THIS)
android_egl_context_restore(Android_Window);
SDL_UnlockMutex(Android_ActivityMutex);
}
+
+ /* Make sure SW Keyboard is restored when an app becomes foreground */
+ if (SDL_IsTextInputActive()) {
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ Android_StartTextInput(_this); /* Only showTextInput */
+ }
}
} else {
if (SDL_SemTryWait(Android_PauseSem) == 0) {