Skip to content
This repository was archived by the owner on Feb 11, 2021. It is now read-only.

Commit 3d72e94

Browse files
committed
Fix for the Game Center status window always being behind the SDL window (untested!)
1 parent 92792d7 commit 3d72e94

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

src/video/uikit/SDL_uikitopengles.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,9 @@ void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
9090
return;
9191
}
9292
[data->view swapBuffers];
93-
/* since now we've got something to draw
94-
make the window visible */
95-
[data->uiwindow makeKeyAndVisible];
9693

9794
/* we need to let the event cycle run, or the OS won't update the OpenGL view! */
9895
SDL_PumpEvents();
99-
10096
}
10197

10298
SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)

src/video/uikit/SDL_uikitvideo.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
8383
device->SetDisplayMode = UIKit_SetDisplayMode;
8484
device->PumpEvents = UIKit_PumpEvents;
8585
device->CreateWindow = UIKit_CreateWindow;
86+
device->ShowWindow = UIKit_ShowWindow;
87+
device->HideWindow = UIKit_HideWindow;
8688
device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
8789
device->DestroyWindow = UIKit_DestroyWindow;
8890
device->GetWindowWMInfo = UIKit_GetWindowWMInfo;

src/video/uikit/SDL_uikitwindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
typedef struct SDL_WindowData SDL_WindowData;
3030

3131
extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
32+
extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
33+
extern void UIKit_HideWindow(_THIS, SDL_Window * window);
3234
extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
3335
extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
3436
extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,

src/video/uikit/SDL_uikitwindow.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,22 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo
210210

211211
}
212212

213+
void
214+
UIKit_ShowWindow(_THIS, SDL_Window * window)
215+
{
216+
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
217+
218+
[uiwindow makeKeyAndVisible];
219+
}
220+
221+
void
222+
UIKit_HideWindow(_THIS, SDL_Window * window)
223+
{
224+
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
225+
226+
uiwindow.hidden = YES;
227+
}
228+
213229
void
214230
UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
215231
{

0 commit comments

Comments
 (0)