Made the application activity events consistent between iOS and Android
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Jan 2012 13:42:03 -0500
changeset 6191 2c0d35b1af4e
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
--- a/src/core/android/SDL_android.cpp	Sun Jan 08 13:31:22 2012 -0500
+++ b/src/core/android/SDL_android.cpp	Sun Jan 08 13:42:03 2012 -0500
@@ -39,7 +39,7 @@
 #define LOGE(...) do {} while (false)
 
 
-/* Impelemented in audio/android/SDL_androidaudio.c */
+/* Implemented in audio/android/SDL_androidaudio.c */
 extern void Android_RunAudioThread();
 } // C
 
@@ -172,8 +172,8 @@
                                     JNIEnv* env, jclass cls)
 {
     if (Android_Window) {
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
+        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
     }
 }
 
@@ -182,8 +182,8 @@
                                     JNIEnv* env, jclass cls)
 {
     if (Android_Window) {
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_SHOWN, 0, 0);
         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
+        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
     }
 }
 
--- a/src/video/uikit/SDL_uikitappdelegate.m	Sun Jan 08 13:31:22 2012 -0500
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Sun Jan 08 13:42:03 2012 -0500
@@ -140,6 +140,7 @@
 
     SDL_Window *window;
     for (window = _this->windows; window != nil; window = window->next) {
+        SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
         SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
     }
 }
@@ -156,6 +157,7 @@
 
     SDL_Window *window;
     for (window = _this->windows; window != nil; window = window->next) {
+        SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
         SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
     }
 }