Fixed bug 3186 - Android SW keyboard not restored when app becomes foreground.
authorSylvain Becker <sylvain.becker@gmail.com>
Sun, 30 Dec 2018 15:39:37 +0100
changeset 1248855f828c2af46
parent 12487 b2422f30f0a6
child 12489 ed2da1cc4d4e
Fixed bug 3186 - Android SW keyboard not restored when app becomes foreground.
src/core/android/SDL_android.c
     1.1 --- a/src/core/android/SDL_android.c	Sun Dec 30 14:23:25 2018 +0100
     1.2 +++ b/src/core/android/SDL_android.c	Sun Dec 30 15:39:37 2018 +0100
     1.3 @@ -805,6 +805,13 @@
     1.4      __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
     1.5  
     1.6      if (Android_Window) {
     1.7 +
     1.8 +        /* Make sure SW Keyboard is restored when an app becomes foreground */
     1.9 +        if (SDL_IsTextInputActive()) {
    1.10 +            SDL_VideoDevice *_this = SDL_GetVideoDevice();
    1.11 +            Android_StartTextInput(_this); /* Only showTextInput */
    1.12 +        }
    1.13 +
    1.14          SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
    1.15          SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
    1.16          SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);