Re-hide MacPass if it was shown only for autotype candidate selection (fixes #964)

This commit is contained in:
Michael Starke
2020-01-13 13:46:24 +01:00
parent e6bb9ad191
commit 626bb35f80
3 changed files with 24 additions and 11 deletions

View File

@@ -258,13 +258,11 @@ static MPAutotypeDaemon *_sharedInstance;
[autotypeCandidates addObjectsFromArray:contexts];
}
}
NSUInteger candidates = autotypeCandidates.count;
if(candidates == 0) {
return nil;
}
if(candidates == 1 ) {
if(autotypeCandidates.count <= 1) {
return autotypeCandidates.lastObject;
}
[self _presentCandiadates:autotypeCandidates forWindowTitle:windowTitle];
return nil; // Nothing to do, we get called back by the window
}
@@ -340,9 +338,9 @@ static MPAutotypeDaemon *_sharedInstance;
if(zIndex < minZIndex) {
minZIndex = zIndex;
infoDict = @{
kMPWindowTitleKey: windowTitle,
kMPProcessIdentifierKey : processId
};
kMPWindowTitleKey: windowTitle,
kMPProcessIdentifierKey : processId
};
}
}
}
@@ -363,6 +361,11 @@ static MPAutotypeDaemon *_sharedInstance;
MPAutotypeCandidateSelectionViewController *vc = [[MPAutotypeCandidateSelectionViewController alloc] init];
vc.candidates = candidates;
vc.windowTitle = windowTitle;
if(NSRunningApplication.currentApplication.isHidden) {
vc.completionHandler = ^{
[NSRunningApplication.currentApplication hide];
};
}
self.matchSelectionWindow.collectionBehavior |= (NSWindowCollectionBehaviorFullScreenAuxiliary |
NSWindowCollectionBehaviorMoveToActiveSpace |
NSWindowCollectionBehaviorTransient );