mortie / swaylock-effects

Swaylock, with fancy effects
MIT License
713 stars 47 forks source link

Wrong Input during waking up screen #52

Open Iss-in opened 3 years ago

Iss-in commented 3 years ago

To reproduce

Expected Behaviour

Error

Issue : swaylock-effect is not parsing first keypress correctly, once I press the key after screen is turned off, I have to press backspace 7-9 times to clear the password input text completely and only then I can re-enter my password Present in both swaylock-effects and swaylock-effects-git

swayidle error : [pam.c:101] pam_authenticate failed: unknown error (6)

swayidle command to test : swayidle -w timeout 10 'swaylock -f -c 000000' timeout 20 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 000000'

mindrunner commented 3 years ago

Seems to be an upstream issue as well:

https://github.com/swaywm/swaylock/issues/188

Iss-in commented 3 years ago

this is weird, pretty sure when I opened this issue, I had no problem with swallock upstream at that time. might have to recheck it

Iss-in commented 3 years ago

nvm, same issue upstream too

mindrunner commented 3 years ago

I just recently switched from swaylock to swaylock-effects and I am pretty sure I experienced it on both lockscreens.

mortie commented 3 years ago

I’m pretty sure this is just by design. The focused window just doesn’t receive the input event which wakes up the screen. You can hit some key (or move the mouse, touch a touch screen, or do anything else to wake up the screen) and then type in the password, but if the event which wakes up the screen is the first character of your password, that will be swallowed.

I’m sure there’s a way to get around this, but I don’t think it’s worth it necessarily. (Though if upstream Swaylock was to fix it, I’d merge in that change of course.)

Iss-in commented 3 years ago

@mortie it's fine if its just swallowing the ist key, if so we can just hit an additional key before typing the password.

instead, while dpms off, pressing a key somehow seems to add 4 or some extra letters to swaylock password input which we have to manually remove by backspace and then type the password.

mindrunner commented 3 years ago

I’m pretty sure this is just by design. The focused window just doesn’t receive the input event which wakes up the screen.

I do not agree with that.

Pressing a key in DPMS mode will wake up the screesn as well as making swaylock recognizing one (sometimes multiple) keystrokes. But not the one which was pressed unfortunately.

it's fine if its just swallowing the ist key, if so we can just hit an additional key before typing the password.

I personally hate that and see no reason why it should be like that. Microsoft Windows has this annoying feature... Coming from i3 and i3lock. It is well implemented there and I could always just type the password, hit enter and the screen was unlocked even before the screen woke up. Missing that :(

mindrunner commented 3 years ago

Quick (still annoying) workaround: Always press before typing your password and you should be not typing twice :)