]> git.saurik.com Git - veency.git/commitdiff
Replace -[UIScreen scale] with GSMainScreenScaleFactor.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 5 Apr 2013 23:17:56 +0000 (23:17 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 5 Apr 2013 23:17:56 +0000 (23:17 +0000)
Tweak.mm

index f18bab58c4eb83a1e0ead93591fd8644084633bf..7b26ede7c9c7ea4b49228f618d6e35df8a3ec662 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -155,6 +155,8 @@ static rfbClientPtr client_;
 static void VNCSetup();
 static void VNCEnabled();
 
+float (*$GSMainScreenScaleFactor)();
+
 static void OnUserNotification(CFUserNotificationRef notification, CFOptionFlags flags) {
     [condition_ lock];
 
@@ -225,11 +227,10 @@ static void OnUserNotification(CFUserNotificationRef notification, CFOptionFlags
 + (void) registerClient {
     // XXX: this could find a better home
     if (ratio_ == 0) {
-        UIScreen *screen([UIScreen mainScreen]);
-        if ([screen respondsToSelector:@selector(scale)])
-            ratio_ = [screen scale];
+        if ($GSMainScreenScaleFactor == NULL)
+            ratio_ = 1.0f;
         else
-            ratio_ = 1;
+            ratio_ = $GSMainScreenScaleFactor();
     }
 
     ++clients_;
@@ -833,6 +834,7 @@ MSInitialize {
     sysctlbyname("hw.machine", machine, &size, NULL, 0);
     iPad1_ = strcmp(machine, "iPad1,1") == 0;
 
+    dlset($GSMainScreenScaleFactor, "GSMainScreenScaleFactor");
     dlset($GSEventCreateKeyEvent, "GSEventCreateKeyEvent");
     dlset($GSCreateSyntheticKeyEvent, "_GSCreateSyntheticKeyEvent");
     dlset($IOMobileFramebufferIsMainDisplay, "IOMobileFramebufferIsMainDisplay");