]> git.saurik.com Git - cydia.git/commitdiff
Work around /stupid/ screenSize miscalculation in WebKit.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Mar 2011 08:53:51 +0000 (01:53 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Mar 2011 08:53:51 +0000 (01:53 -0700)
MobileCydia.mm

index a85c12e492b540986d64cd24fc2595876d65a482..27131833f09369af09d116311c5dd619f02b25b4 100644 (file)
@@ -10344,6 +10344,10 @@ MSHook(id, NSURLConnection$init$, NSURLConnection *self, SEL _cmd, NSURLRequest
     } return self;
 }
 
+static CGSize $WAKWindow$screenSize(id self, SEL _cmd) {
+    return [[UIScreen mainScreen] bounds].size;
+}
+
 int main(int argc, char *argv[]) {
     NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
 
@@ -10410,6 +10414,10 @@ int main(int argc, char *argv[]) {
     /* Library Hacks {{{ */
     class_addMethod(objc_getClass("DOMNodeList"), @selector(countByEnumeratingWithState:objects:count:), (IMP) &DOMNodeList$countByEnumeratingWithState$objects$count$, "I20@0:4^{NSFastEnumerationState}8^@12I16");
 
+    if (Class $WAKWindow = objc_getClass("WAKWindow"))
+        if (Method method = class_getInstanceMethod($WAKWindow, @selector(screenSize)))
+            method_setImplementation(method, (IMP) &$WAKWindow$screenSize);
+
     $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSource");
 
     Method CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(class_getInstanceMethod($CFXPreferencesPropertyListSource, @selector(_backingPlistChangedSinceLastSync)));