diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 8d3e3c433..ecc695d25 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -343,6 +343,7 @@ SDL_LoadLaunchImageNamed(NSString *name, int screenh) window.alpha = 0.0; } completion:^(BOOL finished) { window.hidden = YES; + UIKit_ForceUpdateHomeIndicator(); /* Wait for launch screen to hide so settings are applied to the actual view controller. */ }]; } diff --git a/src/video/uikit/SDL_uikitmessagebox.m b/src/video/uikit/SDL_uikitmessagebox.m index 16a0c2122..b14a3c019 100644 --- a/src/video/uikit/SDL_uikitmessagebox.m +++ b/src/video/uikit/SDL_uikitmessagebox.m @@ -108,19 +108,7 @@ UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, in alertwindow.hidden = YES; } -#if !TARGET_OS_TV - /* Force the main SDL window to re-evaluate home indicator state */ - SDL_Window *focus = SDL_GetFocusWindow(); - if (focus) { - SDL_WindowData *data = (__bridge SDL_WindowData *) focus->driverdata; - if (data != nil) { - if (@available(iOS 11.0, *)) { - [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden) withObject:nil waitUntilDone:NO]; - [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures) withObject:nil waitUntilDone:NO]; - } - } - } -#endif /* !TARGET_OS_TV */ + UIKit_ForceUpdateHomeIndicator(); *buttonid = messageboxdata->buttons[clickedindex].buttonid; return YES; diff --git a/src/video/uikit/SDL_uikitvideo.h b/src/video/uikit/SDL_uikitvideo.h index c43ed80b8..4e12855c1 100644 --- a/src/video/uikit/SDL_uikitvideo.h +++ b/src/video/uikit/SDL_uikitvideo.h @@ -39,6 +39,8 @@ CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen); void UIKit_SuspendScreenSaver(_THIS); +void UIKit_ForceUpdateHomeIndicator(void); + SDL_bool UIKit_IsSystemVersionAtLeast(double version); #endif /* SDL_uikitvideo_h_ */ diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index f0103aecc..7c21d16c2 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -221,6 +221,24 @@ UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen) return frame; } +void +UIKit_ForceUpdateHomeIndicator() +{ +#if !TARGET_OS_TV + /* Force the main SDL window to re-evaluate home indicator state */ + SDL_Window *focus = SDL_GetFocusWindow(); + if (focus) { + SDL_WindowData *data = (__bridge SDL_WindowData *) focus->driverdata; + if (data != nil) { + if (@available(iOS 11.0, *)) { + [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden) withObject:nil waitUntilDone:NO]; + [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures) withObject:nil waitUntilDone:NO]; + } + } + } +#endif /* !TARGET_OS_TV */ +} + /* * iOS log support. *