From 2a412eb94c31b2aa7ba36e7a713f665db8352b39 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Sun, 30 Dec 2018 15:39:37 +0100 Subject: [PATCH] Fixed bug 3186 - Android SW keyboard not restored when app becomes foreground. --- src/core/android/SDL_android.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index caa9b47cb..e93702b16 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -805,6 +805,13 @@ 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);