]> git.saurik.com Git - veency.git/commitdiff
Stupid/silly statusbar bug. v0.9.3023
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 30 Aug 2009 05:47:02 +0000 (05:47 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 30 Aug 2009 05:47:02 +0000 (05:47 +0000)
Tweak.mm
control

index 9c84689935830cd3b1b7fbf8041d8ad1af0dd260..f969bf622aac5c26ecb3bc0940955baa8b814e32 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -88,18 +88,39 @@ static NSLock *lock_;
 
 static rfbClientPtr client_;
 
-static void VNCAccept() {
-    action_ = RFB_CLIENT_ACCEPT;
+@interface VNCBridge : NSObject {
+}
+
++ (void) askForConnection;
++ (void) removeStatusBarItem;
++ (void) registerClient;
+
+@end
+
+@implementation VNCBridge
+
++ (void) askForConnection {
+    [[$SBAlertItemsController sharedInstance] activateAlertItem:[[[$VNCAlertItem alloc] init] autorelease]];
+}
+
++ (void) removeStatusBarItem {
+    [[$SBStatusBarController sharedStatusBarController] removeStatusBarItem:@"Veency"];
+}
+
++ (void) registerClient {
     ++clients_;
     [[$SBStatusBarController sharedStatusBarController] addStatusBarItem:@"Veency"];
 }
 
+@end
+
 MSInstanceMessage2(void, VNCAlertItem, alertSheet,buttonClicked, id, sheet, int, button) {
     [condition_ lock];
 
     switch (button) {
         case 1:
-            VNCAccept();
+            action_ = RFB_CLIENT_ACCEPT;
+            [VNCBridge registerClient];
         break;
 
         case 2:
@@ -125,26 +146,6 @@ MSInstanceMessage0(void, VNCAlertItem, performUnlockAction) {
     [[$SBAlertItemsController sharedInstance] activateAlertItem:self];
 }
 
-@interface VNCBridge : NSObject {
-}
-
-+ (void) askForConnection;
-+ (void) removeStatusBarItem;
-
-@end
-
-@implementation VNCBridge
-
-+ (void) askForConnection {
-    [[$SBAlertItemsController sharedInstance] activateAlertItem:[[[$VNCAlertItem alloc] init] autorelease]];
-}
-
-+ (void) removeStatusBarItem {
-    [[$SBStatusBarController sharedStatusBarController] removeStatusBarItem:@"Veency"];
-}
-
-@end
-
 static mach_port_t (*GSTakePurpleSystemEventPort)(void);
 static bool PurpleAllocated;
 static bool Two_;
@@ -170,9 +171,10 @@ static void VNCSettings() {
         [reinterpret_cast<NSString *>(screen_->authPasswdData) release];
         screen_->authPasswdData = NULL;
 
-        if (NSString *password = [settings objectForKey:@"Password"])
-            if ([password length] != 0)
-                screen_->authPasswdData = [password retain];
+        if (settings != nil)
+            if (NSString *password = [settings objectForKey:@"Password"])
+                if ([password length] != 0)
+                    screen_->authPasswdData = [password retain];
     }
 }
 
@@ -356,8 +358,11 @@ static void VNCDisconnect(rfbClientPtr client) {
 
 static rfbNewClientAction VNCClient(rfbClientPtr client) {
     @synchronized (condition_) {
-        if (screen_->authPasswdData != NULL)
+        if (screen_->authPasswdData != NULL) {
+            [VNCBridge performSelectorOnMainThread:@selector(registerClient) withObject:nil waitUntilDone:YES];
+            client->clientGoneHook = &VNCDisconnect;
             return RFB_CLIENT_ACCEPT;
+        }
     }
 
     [condition_ lock];
@@ -368,6 +373,7 @@ static rfbNewClientAction VNCClient(rfbClientPtr client) {
     rfbNewClientAction action(action_);
     action_ = RFB_CLIENT_ON_HOLD;
     [condition_ unlock];
+
     if (action == RFB_CLIENT_ACCEPT)
         client->clientGoneHook = &VNCDisconnect;
     return action;
diff --git a/control b/control
index ed16c3a7936a4e82974b5d6d1e7bf7b537eaf57a..729808242634aefe4ee8271977385c847a3573ac 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.3022-1
+Version: 0.9.3023-1
 Description: a VNC /server/ for the iPhone
 Name: Veency
 Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver, com.saurik.iphone.ske, preferenceloader