Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading