1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

iOS: allow ignoring the safe area (#11210) (#15951)

This commit is contained in:
Eric Warmenhoven 2023-11-26 07:59:22 -05:00 committed by GitHub
parent 2b820bdf10
commit d7708ad84a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -1987,7 +1987,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_NOTCH_WRITE_OVER,
"Enable fullscreen over notch in Android devices"
"Enable fullscreen over notch in Android and iOS devices"
)
/* Settings > Video > CRT SwitchRes */

View File

@ -12070,7 +12070,7 @@ static bool setting_append_list(
/* prevent unused function warning on unsupported builds */
(void)setting_get_string_representation_int_gpu_index;
#ifdef ANDROID
#if defined(ANDROID) || TARGET_OS_IOS
CONFIG_BOOL(
list, list_info,
&settings->bools.video_notch_write_over_enable,

View File

@ -379,10 +379,21 @@ void *glkitview_init(void);
* the notch in iPhone X phones */
if (@available(iOS 11, *))
{
settings_t *settings = config_get_ptr();
RAScreen *screen = (BRIDGE RAScreen*)cocoa_screen_get_chosen();
CGRect screenSize = [screen bounds];
UIEdgeInsets inset = [[UIApplication sharedApplication] delegate].window.safeAreaInsets;
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (settings->bools.video_notch_write_over_enable)
{
self.view.frame = CGRectMake(screenSize.origin.x,
screenSize.origin.y,
screenSize.size.width,
screenSize.size.height);
return;
}
switch (orientation)
{
case UIInterfaceOrientationPortrait: