Closed Aldaviva closed 5 months ago
Maybe I should remove this entire feature because it was only really there to improve sirAndros/KeePassWinHello, which was improved in 3.3.1. It still doesn't get focus, but at least it's on top, and making another program's window get focus is nearly impossible in Windows.
Moved this code to the foreground-prompt branch.
On a 0.1.0 developer build from 4/8,
AuthenticatorChooser.exe
crashed when the Windows Security dialog box appeared to prompt me for my fingerprint to unlock KeePass with KeePassWinHelloPlugin installed. AuthenticatorChooser was not running elevated. Win11 23H2 x64.There is no corresponding .NET runtime stacktrace event in the Application log, so the crash must have been in unmanaged code in
kernelbase.dll
. The new code in this developer build tries to bring these windows to the foreground and activate them, so they are visible to the user and not stuck hidden behind all other windows. Restarting AuthenticatorChooser while the same credential prompt is still visible does not reproduce the crash. Similarly, opening new credential prompt windows also does not reproduce the crash.This might be just a race with any of the Win32 API calls AuthenticatorChooser makes as part of bringing the window to the foreground. I guess those should all be in a try block, and just proceed if any of them fail.