From 458355076924333b4d4b524310ea4b3cdb622585 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 12 Jul 2009 13:26:43 +0000 Subject: [PATCH] Ported back to 2.x. --- Tweak.mm | 12 ++++++++++++ control | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Tweak.mm b/Tweak.mm index dea38a3..a5e7767 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -151,6 +151,12 @@ void VNCAlertItem$performUnlockAction(id self, SEL sel) { static mach_port_t (*GSTakePurpleSystemEventPort)(void); static bool PurpleAllocated; +static bool Two_; + +static void FixRecord(GSEventRecord *record) { + if (Two_) + memmove(&record->windowContextId, &record->windowContextId + 1, sizeof(*record) - (reinterpret_cast(&record->windowContextId + 1) - reinterpret_cast(record)) + record->size); +} static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { x_ = x; y_ = y; @@ -174,6 +180,7 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { record.timestamp = GSCurrentEventTimestamp(); + FixRecord(&record); GSSendSystemEvent(&record); } @@ -188,6 +195,7 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { record.timestamp = GSCurrentEventTimestamp(); + FixRecord(&record); GSSendSystemEvent(&record); } @@ -202,6 +210,7 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { record.timestamp = GSCurrentEventTimestamp(); + FixRecord(&record); GSSendSystemEvent(&record); } @@ -253,6 +262,7 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { port = purple; } + FixRecord(&event.record); GSSendEvent(&event.record, port); } @@ -425,6 +435,8 @@ extern "C" void TweakInitialize() { PurpleAllocated = true; } + Two_ = dlsym(RTLD_DEFAULT, "GSEventGetWindowContextId") == NULL; + MSHookFunction(&IOMobileFramebufferSwapSetLayer, &$IOMobileFramebufferSwapSetLayer, &_IOMobileFramebufferSwapSetLayer); $SBAlertItemsController = objc_getClass("SBAlertItemsController"); diff --git a/control b/control index 9366e92..46771e3 100644 --- a/control +++ b/control @@ -5,7 +5,7 @@ Priority: optional Section: Networking Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.2970-1 +Version: 0.9.2971-1 Description: a VNC /server/ for the iPhone Name: Veency Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver -- 2.47.2