]> git.saurik.com Git - veency.git/commitdiff
Solve compatibility issue with HP LaserJet 2605dn printers.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 26 May 2010 22:20:12 +0000 (22:20 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 26 May 2010 22:20:12 +0000 (22:20 +0000)
Tweak.mm
control

index c3898efbb54f8206bcc758f63f1eab6e6def0052..d732666fe1dee75f50dfc2b302e8cd692ffdb0d0 100644 (file)
--- 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 e361a4df54617e1d6da8162b05d1cd0239936b49..5f72a8b95484b3a8221e14b0393d2b4c094690b2 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.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)