mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Runs Mac password dialog on main UI thread
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user