#1082 Crash on "wrong" window closing order.



I think that this ticket may be two-fold, as it is indicative of two separate issues.

Running the latest Keepass 1 available for the moment, 1.25, on Windows 8 (although I'm not convinced it is specific to the OS version).

I did install Keepass around 1.22 while running Windows 7, which then have been migrated using the Windows 8 upgrade installation, so the issue could also be related to updating Keepass from older versions, or coupled to the Windows migration, but I believe it to be easy to reproduce.

The steps needed to reproduce the bug(s) on my end:
(Prerequisite is "Minimize to tray instead of taskbar" I believe)

  1. Open Keepass
  2. Double click any entry to show the edit/view dialog.
  3. Double click the tray icon. This in my case moves the focus from the edit/view dialog to the main window.
  4. Press Escape

Now, the main Keepass window will dissapear, the tray icon will indicate that the database is locked, and depending on what you do next the results will be interesting.

  • Pushing Escape again or clicking the top right X generates a crash.
  • Pushing the cancel button closes it gracefully, just leaving you with the locked tray icon as a trace.

I have not yet had the guts to try the OK button, seeing as I'm getting enough problems already. :)


  • Patrik Thunström

    I can also add, after noticing the real "culprit" in how I get things to crash most open:

    The Ctrl-Alt-K hotkey. It also gives the same effect as double clicking the tray icon.

    I tend to open KeePass, view a password show/edit dialog, wander of somewhere else and forget about having the dialog open. Then, when I visit another web page where I need to log in, and Ctrl-Alt-A does not work for global auto type, I use Ctrl-Alt-K instead to search for the page.

    When KeePass jumps up, it's the same, the show/edit dialog is open, but the main window is in focus. So, my instant reaction is to push escape to close the show/edit dialog, while the actual effect right now is that the main window is closed...

  • Paul

    Paul - 2013-01-31

    It doesn't happen on my W7 system. I don't have a W8 to try, but I know someone who might.

    cheers, Paul

  • Dominik Reichl

    Dominik Reichl - 2013-01-31

    I can reproduce the issue; thanks for reporting it.

  • Dominik Reichl

    Dominik Reichl - 2013-02-20
    • status: open --> closed
  • Dominik Reichl

    Dominik Reichl - 2013-02-20

    I've implemented a solution now: when activating the main window while a dialog is opened, the main window redirects the activation to the dialog.

    Here's the latest development snapshot for testing:

    Thanks again, best regards,

  • Dominik Reichl

    Dominik Reichl - 2013-02-20

    The issue existed in a similar form in KeePass 2.x. I've now added an activation redirection here, too.

    Here's the latest development snapshot for testing:

    Best regards,

  • Paul

    Paul - 2013-02-21

    Dominik, there is a special case where this doesn't work - neither did 2.21.
    If you open a PICKCHARS window but then change focus - maybe you wanted to make sure the cursor was in the correct field - you can't get the PICKCHARS window back by clicking on the KeePass icon. The development version does bring the window to the front, but KeePass comes up behind it and prevents the selected characters being typed into the browser / program. In these circumstances only the PICKCHARS window should return to the front, retaining the current window as the target for the Auto-Type.

    cheers, Paul

  • Dominik Reichl

    Dominik Reichl - 2013-02-22

    Excellent observation, thanks for reporting it, Paul! KeePass cannot prevent the main window coming to the front (because Windows brings the main window to the foreground and notifies KeePass afterwards; hiding it immediately would be confusing), but I've added code now such that the previously active window is reactivated explicitly after closing the character picking dialog (thus preventing the picked characters from going to the KeePass main window).

    Here's the latest development snapshot for testing:

    Thanks again, best regards,

  • Paul

    Paul - 2013-02-22

    Seems to be perfect, but I use it for CC transactions so I've not tested it live.
    If I see an opportunity to test it live I'll give it a go.

    cheers, Paul


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks