Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KeePassNatMsg/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.13")]
[assembly: AssemblyVersion("2.0.17")]
20 changes: 18 additions & 2 deletions KeePassNatMsg/Protocol/Handlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,25 @@ private bool UnlockDatabase(bool triggerUnlock)
lock (_unlockLock)
{
var config = new ConfigOpt(_host.CustomConfig);
if (!_host.Database.IsOpen && config.UnlockDatabaseRequest && KeePass.UI.GlobalWindowManager.WindowCount == 0 && triggerUnlock)
if (!_host.Database.IsOpen && config.UnlockDatabaseRequest && triggerUnlock)
{
_host.MainWindow.Invoke(new System.Action(() => _host.MainWindow.OpenDatabase(_host.MainWindow.DocumentManager.ActiveDocument.LockedIoc, null, false)));
_host.MainWindow.Invoke(new System.Action(() =>
{
if (KeePass.UI.GlobalWindowManager.WindowCount == 0)
{
// No dialog open yet for this database — start a fresh one.
_host.MainWindow.OpenDatabase(_host.MainWindow.DocumentManager.ActiveDocument.LockedIoc, null, false);
}
else
{
// A dialog (likely the master-key prompt from an earlier
// triggerUnlock, or KeePass's own auto-lock prompt) may
// already be open but hidden behind other windows.
// Bring KeePass to the foreground so the user actually
// sees it, instead of silently doing nothing.
_host.MainWindow.Activate();
}
}));
}

return _host.Database.IsOpen;
Expand Down