keepassxreboot / keepassxc

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

Keepassxc replaces the 1st character of username when using Auto-type (Wayland + specific websites) #6009

Closed Saroumane closed 3 years ago

Saroumane commented 3 years ago

Overview

Under specific conditions, Keepassxc replaces the 1st character of username when using Auto-type. Conditions :

Steps to Reproduce

  1. Go to https://***** (banking website, can disclose privately)
  2. Type the key combination to trigger Auto-type in username field. (My custom Auto-type is very basic : {USERNAME} )

Expected Behavior

I expect the username to be filled in username field without alteration

Actual Behavior

The first character of the username (the number 3) is replaced by the character quote ("). I don't know if it's a pure coincidence, but on my french keyboard, 3 and " are on the same key. (first row under function keys, 4th key from the left)

Context

I don't reproduce the problem under X, only with Wayland. I saw the problem on other websites (I don't remember which ones) My custom Auto-type is not guilty, I reproduce the problem with default Auto-type.

Workaround

Use a custom Auto-type and add {CLEARFIELD} before {USERNAME}.

KeePassXC - 2.6.1 Revision: 9a35bba

Operating System: Linux (Ubuntu) Desktop Env: Gnome Windowing System: Wayland

droidmonkey commented 3 years ago

324

Saroumane commented 3 years ago

Interesting, but :

Does not really sounds like a duplicate to me, but you are the expert :)

droidmonkey commented 3 years ago

You aren't using Wayland if you are using autotype (in the backend). You are using X11 connected to Wayland through xwayland. The error could be in that interface boundary, not sure. The error could also be with your browser, Firefox has been known to eat keys and screw up autotype if the delay between keystrokes is too low. You can try increasing the keystroke delay in the autotype settings.

Saroumane commented 3 years ago

You aren't using Wayland if you are using autotype (in the backend). You are using X11 connected to Wayland through xwayland.

Indeed.

The error could be in that interface boundary, not sure. The error could also be with your browser, Firefox has been known to eat keys and screw up autotype if the delay between keystrokes is too low.

I use Chromium.

You can try increasing the keystroke delay in the autotype settings.

Already tried, no success. But that's OK, I'll stick with {CLEARFIELD} By the way, thanks for all the good work you have done for keepassxc. (Out of scope : as droidmonkey do you recommend KeePassDroid or KeePassDX on android ?)

droidmonkey commented 3 years ago

I use KeePassDX, it is a modern interface and matured quickly

droidmonkey commented 3 years ago

Reopened this to take another look, but it might be very unique to your system.

stefan123t commented 3 years ago

@Saroumane what is the keyboard layout setting on your Desktop environment ? Do you have another keyboard layout configured besides French/AZERTY ? How is keyboard layout switching configured (per window or global Alt-Shift) ? What are the results of setxkbmap -print -verbose 10 | grep '\(layout\|xkb_symbols\)' ? Kind regards, Stefan

Saroumane commented 3 years ago

@stefan123t No switching needed, only one keyboard : Ubuntu/Gnome builtin "French (AZERTY)" (the most used French keyboard)

image

$ setxkbmap -print -verbose 10 | grep '\(layout\|xkb_symbols\)'
layout:     us
    xkb_symbols   { include "pc+us+inet(evdev)" };
stefan123t commented 3 years ago

@Saroumane funny that it says in setxkbmap you are using Englisch (US) / pc+us but the Gnome config clearly says your input source being French (AZERTY). This is a contradiction and it may be explained the way @droidmonkey pointed to, i.e. with the path over xwayland there might be a need to switch between those keyboard layouts, which is replacing your first character ?

Saroumane commented 3 years ago

Well done, you found the guilty setting. I did : $ setxkbmap fr $ setxkbmap -print -verbose 10 | grep '(layout|xkb_symbols)' layout: fr xkb_symbols { include "pc+fr+inet(evdev)" };

then restarted keepassxc, and the problem is solved, no need to {CLEARFIELD} anymore.

To explain the context : my general strategy regarding lang/locales/layout etc is :

Do you think I should open a bug in Gnome ? (Because Gnome UI for "Input sources" forgets to set setxkbmap ?)

stefan123t commented 3 years ago

@Saroumane while I second your motion to keep everything in C / ASCII / en_US.UTF-8 for interoperability and ease of finding error codes I do not know why it does not update the setxkbmap in your place. I assume the native Gnome Input Sources does something different from the Linux Mint > Preferences > System Settings > Keyboard. So yes, it should be worthwhile to raise the issue upstream in Gnome especially with the additional xwayland layer in the play.

Saroumane commented 3 years ago

As a permanent workaround, I tried to put /usr/bin/setxkbmap fr in

but it had no effect.

I cannot use ~/.xinit or ~/.xsession as I understand they are not used by Gnome Wayland

Any other idea ?