mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-05 08:12:35 -08:00
macOS: Return focus to the requesting app after Touch ID unlock
After a browser request unlocked the database with Touch ID, focus stayed on KeePassXC instead of returning to the app that made the request. The last active application is tracked from NSWorkspaceDidDeactivateApplicationNotification. The Touch ID prompt is shown by the coreautha agent, so when it closed it replaced the requesting app, and raiseLastActiveWindow() then activated coreautha, which has no window. Only track regular applications, which skips background agents like coreautha and UserNotificationCenter. Fixes: #14168
This commit is contained in:
1 parent
cd42236540
commit
68fb7e3360
1 file changed
+2
-1
@@ -56,7 +56,8 @@
|
||||
NSDictionary* userInfo = notification.userInfo;
|
||||
NSRunningApplication* app = [userInfo objectForKey:NSWorkspaceApplicationKey];
|
||||
|
||||
if (app.processIdentifier != [self ownProcessId]) {
|
||||
// Skip background agents such as the Touch ID prompt (coreautha), which have no window to return to
|
||||
if (app.processIdentifier != [self ownProcessId] && app.activationPolicy == NSApplicationActivationPolicyRegular) {
|
||||
self.lastActiveApplication = app;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user