From 434040f4a2c6b7abc87eee62a1f6237996399307 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 26 May 2010 22:20:12 +0000 Subject: [PATCH] Solve compatibility issue with HP LaserJet 2605dn printers. --- Tweak.mm | 23 ++++++++++++++++++----- control | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Tweak.mm b/Tweak.mm index c3898ef..d732666 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -146,6 +146,9 @@ static NSLock *lock_; static rfbClientPtr client_; +static void VNCSetup(); +static void VNCEnabled(); + @interface VNCBridge : NSObject { } @@ -172,6 +175,13 @@ static rfbClientPtr client_; [[$SBStatusBarController sharedStatusBarController] addStatusBarItem:@"Veency"]; } ++ (void) performSetup { + NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); + VNCSetup(); + VNCEnabled(); + [pool release]; +} + @end MSInstanceMessage2(void, VNCAlertItem, alertSheet,buttonClicked, id, sheet, int, button) { @@ -576,17 +586,20 @@ MSHook(kern_return_t, IOMobileFramebufferSwapSetLayer, CGRect frame, int flags ) { - if (_unlikely(screen_ == NULL)) { + if (_unlikely(width_ == 0 || height_ == 0)) { CGSize size; IOMobileFramebufferGetDisplaySize(fb, &size); width_ = size.width; height_ = size.height; - NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); - VNCSetup(); - VNCEnabled(); - [pool release]; + NSThread *thread([[[NSThread alloc] + initWithTarget:[VNCBridge class] + selector:@selector(performSetup) + object:nil + ] autorelease]); + + [thread start]; } else if (_unlikely(clients_ != 0)) { if (buffer == NULL) { //CoreSurfaceBufferLock(buffer_, 3); diff --git a/control b/control index e361a4d..5f72a8b 100644 --- a/control +++ b/control @@ -5,7 +5,7 @@ Priority: optional Section: Networking Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.3189-1 +Version: 0.9.3192-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) -- 2.47.2