Skip to content

Commit

Permalink
Fixed bug 3186 - Android SW keyboard not restored when app becomes fo…
Browse files Browse the repository at this point in the history
…reground.
  • Loading branch information
1bsyl committed Dec 30, 2018
1 parent d09774a commit 2a412eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/android/SDL_android.c
Expand Up @@ -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);
Expand Down

0 comments on commit 2a412eb

Please sign in to comment.