keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.28k stars 1.48k forks source link

Make Auto-type Dialog separate from Main Window again #6497

Open stefan123t opened 3 years ago

stefan123t commented 3 years ago

Overview

In KeepassXC 2.7 the application window (I usually have it set to fullscreen) is always coming to front together with the auto-type chooser dialog. This obstructs the view to the window I want to type in, so I have to switch several times to remember which I need to choose: the "password only" or the "username & password" from the usually two entries I have setup in my Keepass DB.

Steps to Reproduce

  1. Setup two keepass entries:
    • one to type the " password only" using {PASSWORD}{ENTER}
    • and a second one using the default " username & password" {USERNAME}{TAB}{PASSWORD}{ENTER}
  2. When you already logged into the site and are returned to the login dialog some sites retain the username and clear only the password field. In order not having to mark the whole username field, e.g. using CTRL+A or {TAB}{SHIFT+TAB} I have setup two Password entries, one referring to the password of the other, so I only have to maintain the password once
  3. When calling the Auto-Type function the Auto-Type dialog to choose from these two entries comes up in front of the Browser Window.
  4. Now with KeepassXC 2.7 also the Main Window is brought to the front, completely obstructing the view of the Login Dialog.
  5. I can switch to the Browser window using Alt+Tab but once I re-activate the Auto-Type Dialog with the Mouse (Mouse follows focus or click) the Main Window is brought to the front again.

Expected Behavior

Only the Auto-Type Dialog should come to the front. IMHO, the Auto-Type Dialog should be de-coupled from the main window again.

Actual Behavior

With KeepassXC 2.7 also the Main Window is brought to the front, completely obstructing the view of the Login Dialog. This is a regression against the older KeepassXC versions I had installed earlier, it was probably introduced with the new "smart" Auto-Type dialog and its new options to choose between Type Sequence, Type password, Type username, Type TOTP, etc. Which is a cool feature indeed, Thanks!

Context

KeePassXC - Version 2.7.0-snapshot Build Type: Snapshot Revision: ee9d0b5

Qt 5.12.8 Debugging mode is enabled.

Operating system: Linux Mint 20.1 CPU architecture: x86_64 Kernel: linux 5.8.0-48-generic

Enabled extensions:

Cryptographic libraries:

hifi commented 2 years ago

There's also a secondary issue with multiple workspaces that the dialog is not brought to the current workspace if the KeePassXC main dialog is not on it. This happens at least on KDE Plasma with the settings I have.

I think we should do this decoupling before 2.7.0 as it should allow the window to be created on the current workspace/desktop the user has open as well.

stefan123t commented 1 year ago

@droidmonkey thanks for the comments in the other issue.

I have since build a keepassxc-8.0-snapshot and looked a bit into the autotype code. Still completely fresh to debugging a Qt5 application, though excuse my newbie questions: Would I debug this in VSCode and do I need any plugins to get this done ? How would I specify the -g to build the keepassxc with debug symbols ?

For me this must have likely changed somewhere in between 2.3.4 and 2.7.0 in the performGlobalAutoType() method. I would therefor like to understand & debug the modality and the three connect() calls in this code block: https://github.com/keepassxreboot/keepassxc/blob/35de5215495ad3d76a35f8b2efbccd28cf3686d8/src/autotype/AutoType.cpp#L467-L498

As I have mentioned in the other issue, the issue is also present for the Database Locked dialog. Hence the first connect() call, which connects the databaseLocked Dialog before actually connecting the selectDialog. Maybe this chaining of dialogs forces a different modality on the AutoTypeSelectDialog ?