Skip to content

fixed dead keys in master password input - #13412

Open
ArnoldSmith86 wants to merge 1 commit into
keepassxreboot:developfrom
ArnoldSmith86:patch-1
Open

fixed dead keys in master password input#13412
ArnoldSmith86 wants to merge 1 commit into
keepassxreboot:developfrom
ArnoldSmith86:patch-1

Conversation

@ArnoldSmith86

Copy link
Copy Markdown

My master key contains a backtick. When showing the password in plain text while entering, I can enter it with the dead key on my German keyboard just fine. But if the input is hidden, the dead key doesn't work and the backtick is simply ommited. I'm using Linux Mint.

I asked Claude to fix it and this PR is what it came up with and it seems to work fine. Looking at the code, the position seems questionable and it might very well not be a desired change if it messes with security. In that case, just close the PR.

Here's the comment that Claude added alongside the code:

+    // QLineEdit::setEchoMode() sets Qt::ImhHiddenText whenever the field is
+    // masked (Password/NoEcho). On Linux that hint causes input methods such as
+    // IBus/Fcitx to disable composition for the field, which breaks dead keys
+    // (e.g. the grave accent ` or other accent dead keys): the character is lost
+    // while masked but works once the password is made visible. Masking is done
+    // by the echo mode itself and does not depend on this hint, so clear it while
+    // keeping ImhSensitiveData/ImhNoPredictiveText so the input method still
+    // won't learn or predict the password.

Testing strategy

I tested my password containing a backtick with a German keyboard on the current develop branch and with the fix.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@varjolintu varjolintu added the pr: ai-assisted Pull request contains significant contributions by generative AI label Jun 7, 2026
@varjolintu

varjolintu commented Jun 7, 2026

Copy link
Copy Markdown
Member

So this basically unhides the input automatically? That is not acceptable. IIRC this bug is related to Qt itself.

@varjolintu varjolintu closed this Jun 7, 2026
@ArnoldSmith86

Copy link
Copy Markdown
Author

So this basically unhides the input automatically? That is not acceptable. IIRC this bug is related to Qt itself.

No, it stays hidden (at least for me, visually). I do see the backtick though while it is waiting for the second keystroke.

@droidmonkey

droidmonkey commented Jun 8, 2026

Copy link
Copy Markdown
Member

Screenshots would be nice to assist immediate review. My understanding is that the IMH for hiden text is rather fundamental to a password field and removing it generally defeats the purpose of having a password field. I would much rather add a warning when setting a master password to avoid using dead keys because of this issue.

@ArnoldSmith86

ArnoldSmith86 commented Jun 9, 2026

Copy link
Copy Markdown
Author

Here's a video of me typing a´b a bunch of times...

cinnamon-2026-06-09T192620+0200.webm

This is keyboard layout "German" and it's the key left of backspace.

image

@droidmonkey droidmonkey reopened this Jun 9, 2026
@droidmonkey

Copy link
Copy Markdown
Member

I will check out the true risk with not having hiddennText set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: ai-assisted Pull request contains significant contributions by generative AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants