mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
IOS7: Fix orientation detection when the view becomes visible
This commit is contained in:
parent
e8d87fb92a
commit
c9b8bf2ca1
@ -57,14 +57,16 @@
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
UIInterfaceOrientation orientationBefore = UIInterfaceOrientationUnknown;
|
||||
UIInterfaceOrientation orientation = UIInterfaceOrientationUnknown;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
orientationBefore = [[[[self view] window] windowScene] interfaceOrientation];
|
||||
orientation = [[[[self view] window] windowScene] interfaceOrientation];
|
||||
} else {
|
||||
orientationBefore = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
orientation = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
}
|
||||
if (orientation != UIInterfaceOrientationUnknown && orientation != currentOrientation) {
|
||||
currentOrientation = orientation;
|
||||
[[iOS7AppDelegate iPhoneView] interfaceOrientationChanged:orientation];
|
||||
}
|
||||
if (currentOrientation != UIInterfaceOrientationUnknown)
|
||||
[[iOS7AppDelegate iPhoneView] interfaceOrientationChanged:currentOrientation];
|
||||
}
|
||||
|
||||
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
|
||||
|
Loading…
Reference in New Issue
Block a user