]> git.saurik.com Git - veency.git/commitdiff
Fix iPad2,x coordinate transform bug. v0.9.3374
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 11 Sep 2011 10:25:39 +0000 (10:25 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 11 Sep 2011 10:25:39 +0000 (10:25 +0000)
Tweak.mm
control

index bbe03389fbe885f3854149a98bc180770901c216..8c86455cef38eb7cec1b7af02e4c9227c4ababa6 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -49,6 +49,7 @@
 
 #include <mach/mach_port.h>
 #include <sys/mman.h>
+#include <sys/sysctl.h>
 
 #import <QuartzCore/CAWindowServer.h>
 #import <QuartzCore/CAWindowServerDisplay.h>
@@ -300,6 +301,8 @@ static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size) {
     }
 }
 
+static bool iPad1_;
+
 static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) {
     if (ratio_ == 0)
         return;
@@ -312,6 +315,11 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) {
         int t(x);
         x = height_ / ratio_ - 1 - y;
         y = t;
+
+        if (!iPad1_) {
+            x = height_ - x;
+            y = width_ - y;
+        }
     }
 
     x_ = x; y_ = y;
@@ -761,6 +769,12 @@ MSInitialize {
     else
         Level_ = 0;
 
+    size_t size;
+    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
+    char machine[size];
+    sysctlbyname("hw.machine", machine, &size, NULL, 0);
+    iPad1_ = strcmp(machine, "iPad1,1") == 0;
+
     dlset($GSEventCreateKeyEvent, "GSEventCreateKeyEvent");
     dlset($GSCreateSyntheticKeyEvent, "_GSCreateSyntheticKeyEvent");
     dlset($IOMobileFramebufferIsMainDisplay, "IOMobileFramebufferIsMainDisplay");
diff --git a/control b/control
index b307ba48e75b85df49d3bcdc9b7ff68f3626a10a..f6878db38d5bea3b58c1b74f444a6aa8b22ec070 100644 (file)
--- a/control
+++ b/control
@@ -5,7 +5,7 @@ Priority: optional
 Section: Networking
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.3345-1
+Version: 0.9.3374-1
 Description: a VNC /server/ for the iPhone
 Name: Veency
 Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver, com.saurik.iphone.ske, preferenceloader, jp.ashikase.mousesupport | firmware (<< 3.0), libstatusbar | firmware (<< 4.0)