Made the application activity events consistent between iOS and Android
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Jan 2012 13:42:03 -0500
changeset 61912c0d35b1af4e
parent 6190 519380462400
child 6193 4da8077393c9
Made the application activity events consistent between iOS and Android
src/core/android/SDL_android.cpp
src/video/uikit/SDL_uikitappdelegate.m
     1.1 --- a/src/core/android/SDL_android.cpp	Sun Jan 08 13:31:22 2012 -0500
     1.2 +++ b/src/core/android/SDL_android.cpp	Sun Jan 08 13:42:03 2012 -0500
     1.3 @@ -39,7 +39,7 @@
     1.4  #define LOGE(...) do {} while (false)
     1.5  
     1.6  
     1.7 -/* Impelemented in audio/android/SDL_androidaudio.c */
     1.8 +/* Implemented in audio/android/SDL_androidaudio.c */
     1.9  extern void Android_RunAudioThread();
    1.10  } // C
    1.11  
    1.12 @@ -172,8 +172,8 @@
    1.13                                      JNIEnv* env, jclass cls)
    1.14  {
    1.15      if (Android_Window) {
    1.16 -        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
    1.17          SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
    1.18 +        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
    1.19      }
    1.20  }
    1.21  
    1.22 @@ -182,8 +182,8 @@
    1.23                                      JNIEnv* env, jclass cls)
    1.24  {
    1.25      if (Android_Window) {
    1.26 -        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_SHOWN, 0, 0);
    1.27          SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
    1.28 +        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
    1.29      }
    1.30  }
    1.31  
     2.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Sun Jan 08 13:31:22 2012 -0500
     2.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Sun Jan 08 13:42:03 2012 -0500
     2.3 @@ -140,6 +140,7 @@
     2.4  
     2.5      SDL_Window *window;
     2.6      for (window = _this->windows; window != nil; window = window->next) {
     2.7 +        SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
     2.8          SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
     2.9      }
    2.10  }
    2.11 @@ -156,6 +157,7 @@
    2.12  
    2.13      SDL_Window *window;
    2.14      for (window = _this->windows; window != nil; window = window->next) {
    2.15 +        SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
    2.16          SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
    2.17      }
    2.18  }