diff --git a/Signal/src/UserInterface/OWSWindowManager.m b/Signal/src/UserInterface/OWSWindowManager.m index c81568a322..e5956c05a6 100644 --- a/Signal/src/UserInterface/OWSWindowManager.m +++ b/Signal/src/UserInterface/OWSWindowManager.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Open Whisper Systems. All rights reserved. +// Copyright (c) 2022 Open Whisper Systems. All rights reserved. // #import "OWSWindowManager.h" @@ -53,19 +53,19 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void) #pragma mark - -@interface OWSWindowRootNavigationViewController : UINavigationController +@interface OWSCallWindowRootNavigationViewController : UINavigationController @end #pragma mark - -@implementation OWSWindowRootNavigationViewController : UINavigationController +@implementation OWSCallWindowRootNavigationViewController : UINavigationController #pragma mark - Orientation - (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIDevice.currentDevice.defaultSupportedOrientations; + return UIDevice.currentDevice.isIPad ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait; } @end @@ -167,8 +167,8 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void) // It adjusts the size of the navigation bar to reflect the // call window. We don't want those adjustments made within // the call window itself. - OWSWindowRootNavigationViewController *navigationController = - [[OWSWindowRootNavigationViewController alloc] initWithRootViewController:viewController]; + OWSCallWindowRootNavigationViewController *navigationController = + [[OWSCallWindowRootNavigationViewController alloc] initWithRootViewController:viewController]; navigationController.navigationBarHidden = YES; OWSAssertDebug(!self.callNavigationController); self.callNavigationController = navigationController; @@ -238,11 +238,7 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void) [self.callNavigationController popToRootViewControllerAnimated:NO]; [self.callNavigationController pushViewController:callViewController animated:NO]; self.shouldShowCallView = YES; - // CallViewController only supports portrait for iPhones, but if we're _already_ landscape it won't - // automatically switch. - if (!UIDevice.currentDevice.isIPad) { - [UIDevice.currentDevice ows_setOrientation:UIDeviceOrientationPortrait]; - } + [self ensureWindowState]; }