From: Jay Freeman (saurik) Date: Sun, 11 Sep 2011 10:25:39 +0000 (+0000) Subject: Fix iPad2,x coordinate transform bug. X-Git-Tag: v0.9.3374^0 X-Git-Url: https://git.saurik.com/veency.git/commitdiff_plain/735c7db50c6a59d2f5d8693a38f43011f08c4d47 Fix iPad2,x coordinate transform bug. --- diff --git a/Tweak.mm b/Tweak.mm index bbe0338..8c86455 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -49,6 +49,7 @@ #include #include +#include #import #import @@ -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 b307ba4..f6878db 100644 --- a/control +++ b/control @@ -5,7 +5,7 @@ Priority: optional Section: Networking Maintainer: Jay Freeman (saurik) 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)