mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-19 01:29:21 +00:00
Fixed regression that resulted in firstResponders not getting correctly updated on view changes
This commit is contained in:
@@ -146,6 +146,14 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
- (void)setContentViewController:(NSViewController *)contentViewController {
|
||||
contentViewController.view.frame = self.window.contentView.frame;
|
||||
[super setContentViewController:contentViewController];
|
||||
if([contentViewController isKindOfClass:MPViewController.class]) {
|
||||
/* enqueue async into main to catch some cases, where the UI would not set the responder correctly */
|
||||
MPDocumentWindowController * __weak welf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSResponder *responder = ((MPViewController *)contentViewController).reconmendedFirstResponder;
|
||||
[welf.window makeFirstResponder:responder];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark MPDocument notifications
|
||||
|
||||
Reference in New Issue
Block a user