Open Database dialog opens after minimizing

Bug #801414 reported by macho
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
keepass2 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

After hitting the minimize button, the "Open Database" dialog immediately opens. I would expect KeePass to stay out of sight until called up again. I'm happy to give you any/all of my settings if needed.

This is with Ubuntu 11.04 version 2.15+dfsg-2+ppa2.
and with Ubuntu 11.10 version 2.16+dfsg-2

Tags: patch
Revision history for this message
Julian Taylor (jtaylor) wrote :

I can't reproduce this issue.
Are you using the default settings?
If not please upload your KeePass.config.xml located in $HOME/.config/KeePass/

Changed in keepass2 (Ubuntu):
status: New → Incomplete
Revision history for this message
macho (macho) wrote :

Here it is.

Julian Taylor (jtaylor)
Changed in keepass2 (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in keepass2 (Ubuntu):
status: New → Confirmed
makl (markusklint)
description: updated
Revision history for this message
makl (markusklint) wrote :

The bug only occur when you enable in the security options the checkbox "Lock workspace when minimizing main window". It seems realy a bug because the behavior does not occure in windows.

makl (markusklint)
description: updated
Revision history for this message
Julian Taylor (jtaylor) wrote :

thanks, I could now reproduce the issue.
I'll see if I can fix it soon.

Changed in keepass2 (Ubuntu):
importance: Undecided → Low
Revision history for this message
makl (markusklint) wrote :

thank you for take care of this issu. If you need people for testing you can contact me.

Revision history for this message
David Sarkozi (dsarko) wrote :

Bug confirmed on Ubuntu 12.10 x64.
Please note that, in fact, the open database dialog shows up everytime the database is locked when the window is minimized, not when you lock it from the window for instance.
For example, if I wish to launch it from the command line with, let's say, the --lock-all option, if an instance of keepass is already running minimized, the dialog will show up, but if the window is maximized and I run the same command, the database locks up and the window minimizes without showing the dialog.
I've been working on a workaround to lock the database after a few minutes of global user inactivity (since the checkbox can't be checked on Ubuntu) with xautolock, and this dialog showing up everytime I lock the database minimized is a pain in the ass...
Wait and see.

Revision history for this message
David Lechner (dlech) wrote :

It looks like mono calls the OnWindowResize event multiple times when you minimize. This patch just short circutis the event handler when it is called multiple times in a row, which fixes the bug.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-fix-launchpad-bug-801414.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Julian Taylor (jtaylor) wrote :

the patch does not seem to have the desired effect for me. It still opens the dialog on minimize.

Revision history for this message
David Lechner (dlech) wrote :

Got it. Apparently having debug breakpoints turned on in a certain place was fixing problem, not the patch. I will try again.

Revision history for this message
David Lechner (dlech) wrote :

It appears that this is a timing issue. This patch seems to do the trick, but it is not the "right" way to fix the problem. I'll have to do some digging in the mono code to figure out why there is a timing issue.

Revision history for this message
David Sarkozi (dsarko) wrote :

At least, thanks a lot for working on it.

Revision history for this message
David Lechner (dlech) wrote :

Dominik (keepass author) figured this out.

quoting from his email...
----
The cause is that during locking, KeePass updates the main window's title bar text (to append a "[Locked]" suffix) and here Mono recreates the window incorrectly. This window recreation can be prevented by faking the private member variable shown_raised of the form to be false while the text is being set. This doesn't seem to have any negative effects (the title bar text is still set, because even without the window recreation the XplatUI.Text method is called; and according to the comment in the Mono source code the window recreation is only required when the text switches between empty and non-empty, which never happens in KeePass as it's always non-empty).

The latest development snapshot for testing is here:
http://keepass.info/filepool/KeePass_130331.zip
http://keepass.info/filepool/KeePass_130331_SrcP.zip
----

Revision history for this message
David Lechner (dlech) wrote :

fixed in v2.22

Changed in keepass2 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.