diff --git a/ui/drivers/cocoa/cocoa_common.m b/ui/drivers/cocoa/cocoa_common.m index 7b4b9f9b94..4c4558ccfe 100644 --- a/ui/drivers/cocoa/cocoa_common.m +++ b/ui/drivers/cocoa/cocoa_common.m @@ -109,12 +109,26 @@ void *glkitview_init(void); - (void)viewWillLayoutSubviews { + float width = 0.0f, height = 0.0f, tenpctw, tenpcth; + RAScreen *screen = (RAScreen*)get_chosen_screen(); UIInterfaceOrientation orientation = self.interfaceOrientation; CGRect screenSize = [[UIScreen mainScreen] bounds]; - float width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize); - float height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize); - float tenpctw = width / 10.0f; - float tenpcth = height / 10.0f; + SEL selector = NSSelectorFromString(BOXSTRING("coordinateSpace")); + + if ([screen respondsToSelector:selector]) + { + screenSize = [[screen coordinateSpace] bounds]; + width = CGRectGetWidth(screenSize); + height = CGRectGetHeight(screenSize); + } + else + { + width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize); + height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize); + } + + tenpctw = width / 10.0f; + tenpcth = height / 10.0f; g_pause_indicator_view.frame = CGRectMake(tenpctw * 4.0f, 0.0f, tenpctw * 2.0f, tenpcth); [g_pause_indicator_view viewWithTag:1].frame = CGRectMake(0, 0, tenpctw * 2.0f, tenpcth);