Fix for the Game Center status window always being behind the SDL window (untested!)
authorSam Lantinga <slouken@libsdl.org>
Sun, 22 Jul 2012 11:24:04 -0700
changeset 6379 8f224d0762ab
parent 6378 58c9e692aec5
child 6380 3990b7d564d7
Fix for the Game Center status window always being behind the SDL window (untested!)
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
--- a/src/video/uikit/SDL_uikitopengles.m	Fri Jul 20 12:57:25 2012 -0700
+++ b/src/video/uikit/SDL_uikitopengles.m	Sun Jul 22 11:24:04 2012 -0700
@@ -90,13 +90,9 @@
         return;
     }
     [data->view swapBuffers];
-    /* since now we've got something to draw
-       make the window visible */
-    [data->uiwindow makeKeyAndVisible];
 
     /* we need to let the event cycle run, or the OS won't update the OpenGL view! */
     SDL_PumpEvents();
-
 }
 
 SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)
--- a/src/video/uikit/SDL_uikitvideo.m	Fri Jul 20 12:57:25 2012 -0700
+++ b/src/video/uikit/SDL_uikitvideo.m	Sun Jul 22 11:24:04 2012 -0700
@@ -83,6 +83,8 @@
     device->SetDisplayMode = UIKit_SetDisplayMode;
     device->PumpEvents = UIKit_PumpEvents;
     device->CreateWindow = UIKit_CreateWindow;
+    device->ShowWindow = UIKit_ShowWindow;
+    device->HideWindow = UIKit_HideWindow;
     device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
     device->DestroyWindow = UIKit_DestroyWindow;
     device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
--- a/src/video/uikit/SDL_uikitwindow.h	Fri Jul 20 12:57:25 2012 -0700
+++ b/src/video/uikit/SDL_uikitwindow.h	Sun Jul 22 11:24:04 2012 -0700
@@ -29,6 +29,8 @@
 typedef struct SDL_WindowData SDL_WindowData;
 
 extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
+extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
+extern void UIKit_HideWindow(_THIS, SDL_Window * window);
 extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
 extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
 extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
--- a/src/video/uikit/SDL_uikitwindow.m	Fri Jul 20 12:57:25 2012 -0700
+++ b/src/video/uikit/SDL_uikitwindow.m	Sun Jul 22 11:24:04 2012 -0700
@@ -211,6 +211,22 @@
 }
 
 void
+UIKit_ShowWindow(_THIS, SDL_Window * window)
+{
+    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
+
+    [uiwindow makeKeyAndVisible];
+}
+
+void
+UIKit_HideWindow(_THIS, SDL_Window * window)
+{
+    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
+
+    uiwindow.hidden = YES;
+}
+
+void
 UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
 {
     SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;