Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

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

Open
nyancow opened this issue Jul 27, 2021 · 9 comments

Comments

@nyancow
Copy link

nyancow commented Jul 27, 2021

#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.

@savchenko
Copy link

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

@nyancow
Copy link
Author

nyancow commented Aug 1, 2021

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: swaywm/wlroots#2706

@savchenko
Copy link

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

@travankor
Copy link
Contributor

Try hikari's screen locker.

@nyancow
Copy link
Author

nyancow commented Aug 2, 2021

Try hikari's screen locker.

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

@travankor
Copy link
Contributor

travankor commented Aug 2, 2021

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

@savchenko
Copy link

No, it's part of the compositor.

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

@travankor
Copy link
Contributor

travankor commented Aug 12, 2021

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.

@savchenko
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants