physlock icon indicating copy to clipboard operation
physlock copied to clipboard

Sway: Unlocking physlock after lid is closed (suspend/sleep) causes blank screen

Open nyancow opened this issue 3 years ago • 9 comments

#96 is similar to my issue, but in my case I am using Sway, not LightDM. swayidle is used to trigger the lock before suspend like so:

swayidle -w \
          timeout 60 'physlock -dsm -p "1"' \
          timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
          before-sleep 'physlock -dsm -p "2"'

When the lid is closed, suspend is triggered according to /etc/systemd/logind.conf which defines:

[Login]
...
HandleLidSwitch=suspend
...

When closing the lid, suspend is indeed triggered, and when waking form suspend, physlock shows a password prompt. But when the correct password is entered, the screen switches to a blank black screen. The only way to fix this is to switch to a different TTY, login, and kill Sway.

Just to clarify, the blank screen does not occur when using physlock during "regular" usage, i.e. without sleep/suspend triggers. If I manually lock, then close the lid and suspend, the blank screen doesn't happen. But in that case, when I wake from suspend, then unlock, then proceed to lock again, this is the output:

physlock -d -s -m
physlock: /dev/tty-1: No such file or directory

And ps aux | grep physlock returns a list of ~60 physlock processes for the root user.

nyancow avatar Jul 27 '21 06:07 nyancow

swaylock appears to be broken and now this... What session lockers are still viable under Wayland?

savchenko avatar Aug 01 '21 13:08 savchenko

Honestly, it's beginning to look like the answer is none. The current state of session lockers is embarrassing. I've tried swaylock, waylock and now physlock, and none of them supply basic out-of-the-box functionality I would expect from a locker (and that's before going into anything regarding design/aesthetics or more advanced capabilities like fingerprint unlocking). I really appreciate the effort that developers are putting into this, but the fact is none of them provide the basic functionality needed:

  • Session lock: no sudden flashes of the unlocked session, no crashes that leave an unlocked session
  • Session unlock: no remaining locked when it's been unlocked, no freezes on wake from sleep, no double locking

You can follow the discussion here, but it doesn't look to be moving forward: https://github.com/swaywm/wlroots/issues/2706

nyancow avatar Aug 01 '21 14:08 nyancow

Reading the relevant topic at Freedesktop/Wayland and https://github.com/swaywm/wlroots/issues/2706 makes me think that exiting to TTY suddenly does not look as bad.

savchenko avatar Aug 01 '21 14:08 savchenko

Try hikari's screen locker.

travankor avatar Aug 02 '21 09:08 travankor

Try hikari's screen locker.

Is it provided in a separate package? If so, I can't seem to find it.

nyancow avatar Aug 02 '21 10:08 nyancow

No, it's part of the compositor. Logo+Shift+Backspace is the keybinding in the default configuration.

travankor avatar Aug 02 '21 12:08 travankor

No, it's part of the compositor.

Well, then it's more of a "switch to another WM".

savchenko avatar Aug 12 '21 02:08 savchenko

Ok, well that was just a suggestion. I'm happy if you fix sway with physlock or update swaylock to use the lockscreen protocol.

Session lock: no sudden flashes of the unlocked session Session unlock: no remaining locked when it's been unlocked, no freezes on wake from sleep, no double locking

BTW, these are either bugs in the compositor or layer shell protocol, not the screen locker.

travankor avatar Aug 12 '21 15:08 travankor

BTW, these are either bugs in the compositor or layer shell protocol, not the screen locker.

This is being discussed here: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/100

savchenko avatar Aug 12 '21 23:08 savchenko