src/core/android/SDL_android.c
changeset 8047 a5270cef21a7
parent 8039 3b0346b37e0f
child 8055 3e2f230a6d62
equal deleted inserted replaced
8046:e7c89b29932a 8047:a5270cef21a7
   318                                     JNIEnv* env, jclass cls)
   318                                     JNIEnv* env, jclass cls)
   319 {
   319 {
   320     __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
   320     __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
   321 
   321 
   322     if (Android_Window) {
   322     if (Android_Window) {
       
   323         SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
       
   324         SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
       
   325         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
       
   326         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
   323         /* Signal the resume semaphore so the event loop knows to resume and restore the GL Context
   327         /* Signal the resume semaphore so the event loop knows to resume and restore the GL Context
   324          * We can't restore the GL Context here because it needs to be done on the SDL main thread
   328          * We can't restore the GL Context here because it needs to be done on the SDL main thread
   325          * and this function will be called from the Java thread instead.
   329          * and this function will be called from the Java thread instead.
   326          */
   330          */
   327         if (!SDL_SemValue(Android_ResumeSem)) SDL_SemPost(Android_ResumeSem);
   331         if (!SDL_SemValue(Android_ResumeSem)) SDL_SemPost(Android_ResumeSem);
   328         
       
   329         SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
       
   330         SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
       
   331         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
       
   332         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
       
   333     }
   332     }
   334 }
   333 }
   335 
   334 
   336 void Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
   335 void Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
   337                                     JNIEnv* env, jclass cls,
   336                                     JNIEnv* env, jclass cls,