Merge pull request #3531 from rjcorrig/macdialogfix

client/Mac: Runs Mac password dialog on main UI thread
This commit is contained in:
Bernhard Miklautz 2016-10-11 09:44:53 +02:00 committed by GitHub
commit 4085d45773
3 changed files with 8 additions and 3 deletions

View File

@ -977,7 +977,9 @@ 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];
BOOL ok = dialog.modalCode;
if (ok)
{

View File

@ -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;

View File

@ -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