From 963beb5ec98753f2b485b5af9a18a60eaa143c45 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 5 Apr 2013 23:17:56 +0000 Subject: [PATCH] Replace -[UIScreen scale] with GSMainScreenScaleFactor. --- Tweak.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tweak.mm b/Tweak.mm index f18bab5..7b26ede 100644 --- 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"); -- 2.47.2