Unless you're on a call, all windows respect the orientation mask of the

primary app visible VC.

Fixes:
- Avoid flicker when forgrounding onboarding while in landscape
- Fix status bar in landscape while fingerprint is portrait, same with device linker
pull/2/head
Michael Kirk 6 years ago
parent 530a07f8ca
commit 3be41e8c25

@ -967,13 +967,22 @@ static NSTimeInterval launchStartedAt;
- (UIInterfaceOrientationMask)application:(UIApplication *)application
supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window
{
if (self.windowManager.hasCall) {
if (self.hasCall) {
OWSLogInfo(@"has call");
// The call-banner window is only suitable for portrait display
return UIInterfaceOrientationMaskPortrait;
}
return UIInterfaceOrientationMaskAllButUpsideDown;
UIViewController *_Nullable rootViewController = self.window.rootViewController;
if (!rootViewController) {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
return rootViewController.supportedInterfaceOrientations;
}
- (BOOL)hasCall
{
return self.windowManager.hasCall;
}
#pragma mark Push Notifications Delegate Methods

@ -199,8 +199,8 @@ NS_ASSUME_NONNULL_BEGIN
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
if (self.topViewController) {
return self.topViewController.supportedInterfaceOrientations;
if (self.visibleViewController) {
return self.visibleViewController.supportedInterfaceOrientations;
} else {
return UIInterfaceOrientationMaskAllButUpsideDown;
}

Loading…
Cancel
Save