]> git.saurik.com Git - cydia.git/commitdiff
Fix iOS 7 autorotate (need setRootViewController).
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 24 Dec 2013 09:46:34 +0000 (01:46 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 24 Dec 2013 09:46:34 +0000 (01:46 -0800)
CyteKit/ViewController.mm
MobileCydia.mm
iPhonePrivate.h

index df2ba616573d4568de456c5f97e6c9898d243520..edd87ca00338a6f16d0ed1fc0bf831dce88e1bb7 100644 (file)
@@ -112,6 +112,14 @@ extern bool IsWildcat_;
     return IsWildcat_ || orientation == UIInterfaceOrientationPortrait;
 }
 
+- (NSUInteger) supportedInterfaceOrientations {
+    return IsWildcat_ ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait;
+}
+
+- (BOOL) shouldAutorotate {
+    return YES;
+}
+
 - (void) setPageColor:(UIColor *)color {
     if (color == nil) {
         color = [UIColor groupTableViewBackgroundColor];
index aa8ad5211726712b9ba89d57b9adaaef1a673e5a..8a9590d37e4b01964af7d8abf633bca15165eecd 100644 (file)
@@ -9573,6 +9573,8 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
         return;
 
     [window_ addSubview:[tabbar_ view]];
+    if ([window_ respondsToSelector:@selector(setRootViewController:)])
+        [window_ setRootViewController:tabbar_];
     [[emulated_ view] removeFromSuperview];
     emulated_ = nil;
     [window_ setUserInteractionEnabled:YES];
@@ -10282,6 +10284,8 @@ _trace();
 
     emulated_ = [[[CydiaLoadingViewController alloc] init] autorelease];
     [window_ addSubview:[emulated_ view]];
+    if ([window_ respondsToSelector:@selector(setRootViewController:)])
+        [window_ setRootViewController:emulated_];
 
     [self performSelector:@selector(loadData) withObject:nil afterDelay:0];
 _trace();
index 6f4e70632f57b1fb6c9bf0cf6a1d4f4b8215443e..37e73d6f6bbf2e2aeea59410d2a905306f831e3c 100644 (file)
@@ -418,6 +418,17 @@ extern float const UIScrollViewDecelerationRateNormal;
 - (WebFrame *) contentFrame;
 @end
 
+typedef enum {
+    UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait),
+    UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft),
+    UIInterfaceOrientationMaskLandscapeRight = (1 << UIInterfaceOrientationLandscapeRight),
+    UIInterfaceOrientationMaskPortraitUpsideDown = (1 << UIInterfaceOrientationPortraitUpsideDown),
+    UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
+    UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
+    UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown),
+    UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
+} UIInterfaceOrientationMask;
+
 // extern *; {{{
 extern CFStringRef const kGSDisplayIdentifiersCapability;
 extern float const UIWebViewGrowsAndShrinksToFitHeight;