diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index 391ab8690..97f41854c 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -977,9 +977,11 @@ BOOL mac_authenticate(freerdp* instance, char** username, char** password, dialog.password = [NSString stringWithCString:*password encoding: NSUTF8StringEncoding]; - BOOL ok = [dialog runModal]; + [dialog performSelectorOnMainThread:@selector(runModal) withObject:nil waitUntilDone:TRUE]; - if (ok) + BOOL ok = dialog.modalCode; + + if (ok) { const char* submittedUsername = [dialog.username cStringUsingEncoding: NSUTF8StringEncoding]; diff --git a/client/Mac/PasswordDialog.h b/client/Mac/PasswordDialog.h index 3e22de7dd..7c3999987 100644 --- a/client/Mac/PasswordDialog.h +++ b/client/Mac/PasswordDialog.h @@ -28,6 +28,7 @@ NSString* serverHostname; NSString* username; NSString* password; + BOOL modalCode; } @property (retain) IBOutlet NSTextField* usernameText; @property (retain) IBOutlet NSTextField* passwordText; @@ -39,6 +40,7 @@ @property (retain) NSString* serverHostname; @property (retain) NSString* username; @property (retain) NSString* password; +@property BOOL modalCode; - (BOOL) runModal; diff --git a/client/Mac/PasswordDialog.m b/client/Mac/PasswordDialog.m index 29945a69f..e6e5ac142 100644 --- a/client/Mac/PasswordDialog.m +++ b/client/Mac/PasswordDialog.m @@ -31,6 +31,7 @@ @synthesize serverHostname; @synthesize username; @synthesize password; +@synthesize modalCode; - (id)init { @@ -66,7 +67,7 @@ - (BOOL)runModal { - return [NSApp runModalForWindow:self.window]; + return (self.modalCode = [NSApp runModalForWindow:self.window]); } - (void)dealloc