From 2048d727404f6c0503047df4516ce6c1dcd6547b Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Wed, 9 Oct 2019 21:13:13 +0300 Subject: [PATCH 1/2] [ios] set correct frame of EAGL view on init --- xbmc/platform/darwin/ios/XBMCController.mm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/xbmc/platform/darwin/ios/XBMCController.mm b/xbmc/platform/darwin/ios/XBMCController.mm index b07c617d089a9..b8930a84dc75c 100644 --- a/xbmc/platform/darwin/ios/XBMCController.mm +++ b/xbmc/platform/darwin/ios/XBMCController.mm @@ -572,7 +572,8 @@ - (void)loadView self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view.autoresizesSubviews = YES; - m_glView = [[IOSEAGLView alloc] initWithFrame:self.view.bounds withScreen:[UIScreen mainScreen]]; + m_glView = [[IOSEAGLView alloc] initWithFrame:[self fullscreenSubviewFrame] + withScreen:UIScreen.mainScreen]; [[IOSScreenManager sharedInstance] setView:m_glView]; [m_glView setMultipleTouchEnabled:YES]; @@ -620,12 +621,6 @@ - (void)viewWillAppear:(BOOL)animated [super viewWillAppear:animated]; } //-------------------------------------------------------------- -- (void)viewSafeAreaInsetsDidChange NS_AVAILABLE_IOS(11_0) -{ - [super viewSafeAreaInsetsDidChange]; - m_glView.frame = [self fullscreenSubviewFrame]; -} -//-------------------------------------------------------------- -(void) viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; @@ -686,7 +681,7 @@ - (CGRect)fullscreenSubviewFrame { auto rect = self.view.bounds; if (@available(ios 11.0, *)) - return UIEdgeInsetsInsetRect(rect, self.view.safeAreaInsets); + return UIEdgeInsetsInsetRect(rect, m_window.safeAreaInsets); else return rect; } From 482068dcf975f27f732655a3f9f08f196224d368 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Wed, 9 Oct 2019 21:14:45 +0300 Subject: [PATCH 2/2] [ios] set EAGL layer frame to the size of containing view --- xbmc/platform/darwin/ios/IOSEAGLView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/platform/darwin/ios/IOSEAGLView.mm b/xbmc/platform/darwin/ios/IOSEAGLView.mm index c764524ba2f44..cfebe41791f90 100644 --- a/xbmc/platform/darwin/ios/IOSEAGLView.mm +++ b/xbmc/platform/darwin/ios/IOSEAGLView.mm @@ -60,7 +60,7 @@ + (Class) layerClass //-------------------------------------------------------------- - (void) resizeFrameBuffer { - CGRect frame = [currentScreen bounds]; + auto frame = self.bounds; CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[self layer]; //allow a maximum framebuffer size of 1080p //needed for tvout on iPad3/4 and iphone4/5 and maybe AppleTV3