Skip to content

Commit

Permalink
iOS: allow ignoring the safe area (libretro#11210) (libretro#15951)
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven authored and Sunderland93 committed Dec 26, 2024
1 parent 55c4ab4 commit 36b36d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions ui/drivers/cocoa/cocoa_common.m
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,21 @@ -(void)adjustViewFrameForSafeArea
* 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:
Expand Down

0 comments on commit 36b36d2

Please sign in to comment.