swaywm / swaylock

Screen locker for Wayland
MIT License
836 stars 197 forks source link

keystrokes entered while DPMS is off aren't recognized properly. #188

Open crocket opened 3 years ago

crocket commented 3 years ago

I start typing password while DPMS is off. DPMS turns on while I type password. Somehow, keys entered while DPMS is off aren't recognized properly. I have to enter the password again.

This doesn't happen on my desktop, but it happens on my laptop.

My laptop doesn't have elogind. It uses seatd. My desktop computer uses seatd but has elogind because elogind is required by other programs. Perhaps, it is related to elogind?

How can I debug this issue?

mindrunner commented 3 years ago

Same boat here. Not sure if I am using seatd or elogind. Using sddm as a display manager.

crocket commented 3 years ago
[unix_chkpwd] password check failed for user (xxx)
[swaylock] pam_unix(swaylock:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost=  user=xxx
Iss-in commented 3 years ago

happening without any display manager too with systemd

crocket commented 3 years ago

elogind is a part of systemd.

emersion commented 3 years ago

That is incorrect, elogind is a fork of systemd with everything removed except logind.

crocket commented 3 years ago

I mean elogind is almost the same as logind from systemd. They are meant to be compatible.

kennylevinsen commented 3 years ago

I very much doubt this would have anything to do with seat management of any kind.

I'm more inclined to think it might be a focus handling corner case when outputs are off/re-enable. Or maybe lost input events as sway stalls during output configuration.

adee commented 3 years ago

The cause is the input reconfigure during DPMS on. You can try my patch from here: https://github.com/swaywm/sway/issues/5757#issuecomment-882028355

Iss-in commented 3 years ago

@adee pastebin link doesnt work anymore, can you please share a gist instead

edit : nvm, ublock was the problem

pielgrzym commented 1 year ago

Sorry for necro-bumping :)

I have a similar problem - when I lock with swayidle I make dpms kick in immediately and turn off the monitor. When I start typing when screen is still off I won't be able to log in. Here is the twist: I just typed one letter while screen was off. It turned on the screen and displayed swaylock. When I was pressing backspace I notice it actually typed 4 letters - this is why the password was wrong on first try. Can anyone confirm this behavior?

EDIT: on every typed characted I have to enter backspace twice to reach 'no input' indicator, so the first letter is only doubled when it's typed while screen is off.

EDIT2: no login manager here - launching sway from tty0. I think it's related to multiple monitors somehow - the stationery monitor takes much more time to wake up in comparison to the laptop one - maybe this is somehow causing the issue.

mindrunner commented 1 year ago

Exatly this!!

Workaround:

Type <ESC>[password]<ENTER> to unlock

pielgrzym commented 1 year ago

Yeah, I'm getting used to hitting 'Ctrl' before I start typing :rofl:

pielgrzym commented 1 year ago

This might be related to this issue: https://github.com/swaywm/sway/issues/7112

hramrach commented 4 weeks ago

Swaylock could somewhat alleviate this by indicating how many characters are typed, eg. making the width of the colored part of the ring that's shown in response to keypress fraction of the circle proportional to number of characters typed rather than fixed.

kennylevinsen commented 4 weeks ago

Swaylock could somewhat alleviate this by indicating how many characters are typed

The whole point of swaylock and i3lock's randomized circular typing animation is to not reveal how many characters have been typed at any point, so that someone looking over your should won't easily be able to see your password length.

hramrach commented 4 weeks ago

And with the proposed change they still won't so long as your password is not 5 characters long. The point is to make the initial few characters easy to distinguish so the error of having unexpectedly many at the start is avoided but not make the number typed so far obvious once more than a few are typed.