the-cavalry / light-locker

A simple session-locker for lightdm
GNU General Public License v2.0
221 stars 22 forks source link

light-locker does not work wake up #138

Open maniac0s opened 5 years ago

maniac0s commented 5 years ago

When ever light-locker goes on, I can not go back to my desktop. Screen remains black. When I ctrl-alt-f1 into text-console and back to f7 graphical console, I get a message that the screen is locked and I get redirected to unlock in a few seconds but that never happens. I have to killall light-locker on text console to access my dektop again.

xfce 4.12 debian uname: Linux bla 4.19.0-2-amd64 #1 SMP Debian 4.19.16-1 (2019-01-17) x86_64 GNU/Linux

Zeioth commented 5 years ago

Same here on my laptop. Workarounds that work fine:

Also, I don't experience this issue on my desktop computer, only on my laptop. Please, provide us instructions about the information we can provide in order to help you to fix it. Thank you.

xfce 4.14 arch antergos (latest)

worldofpeace commented 5 years ago

Pantheon users in NixOS can reproduce this issue in certain instances, where it seems like it doesn't switch to the greeter correctly.

worldofpeace commented 5 years ago

Just by looking over the listed issues here they're several possible duplicates.

dpint commented 5 years ago

I have some workarounds for the issues surrounding light-locker and suspend / locking behavior. I tested them on Xubuntu 18.04. I will also give an insight on what may be causing them.

After the computer is suspended, the screen stays black even after computer has already woken up. It is possible to see a mouse cursor, but only for a moment. The only way to get the greeter to show up after that is by switching TTYs (CTRL + ALT + [1-6] and after that CTRL + ALT + 8). If we switch to VT7 we can see a message that current session is locked and after a few seconds we get redirected to the greeter.

The easiest solution to this problem is running light-locker with --no-lock-on-suspend flag and "Lock screen when system is going to sleep" option enabled. This way suspend works when it is triggered from the GUI and when the lid is closed. If we want to suspend computer from the CLI we should use "systemctl suspend" command.

This bug stems from a fact that xfce4-session tries to lock computer itself before sending suspend command. If "Lock screen when system is going to sleep" option is enabled this causes the lock to be called twice and this causes the behavior described above. xfce4-session locking can be observed here:

https://github.com/xfce-mirror/xfce4-session/blob/a81bdec069fd6184eab3818b54bfd646fa3f08be/xfce4-session/xfsm-systemd.c#L257

After the computer is locked, the same behavior as with suspend appears.

One of the solutions is switching from "light-locker-command --lock" to "dm-tool switch-to-greeter" command. If we also want "lock screen" button in Whiskers Menu to work, we have to modify xflock4 script. We have to replace following line: "light-locker-command --lock" with: "dm-tool switch-to-greeter"

This bug seems to be caused by combination of D-BUS methods light-locker calls. It seems that dm-tool calls "SwitchToGreeter" method, whereas light-locker calls "Lock" method.

katsar0v commented 4 years ago

Hm I guess duplicate -> https://github.com/the-cavalry/light-locker/issues/144

One of the solutions is switching from "light-locker-command --lock" to "dm-tool switch-to-greeter" command. If we also want "lock screen" button in Whiskers Menu to work, we have to modify xflock4 script. We have to replace following line: "light-locker-command --lock" with: "dm-tool switch-to-greeter"

fixed it for me

jalovatt commented 4 years ago

I just upgraded Ubuntu Studio from 18.04 to 19.04 and ran into a similar issue - xflock4 would hard freeze the system on a black screen, not even letting me switch to a different TTY. Changing it to run dm-tool switch-to-greeter cleared things right up. Thanks!

QvQQ commented 4 years ago

I'm using Manjaron with xfce 4.14 and having the same issue. Replace light-locker-commmand --lock with dm-tool switch-to-greeter fixed things. Thanks bro!

QvQQ commented 4 years ago

@dpint First I should thanks for your solution of this replacement. However I found a strange performance when I type xflock4 (which actually invokes the command dm-tool switch-to-greeter to show a locked screen) and switch to tty8 (which only shows a blank and black background with a cursor) and then switch back to tty7 again, the locker vanished and I can directly operate the OS. The progress is: lock the screen -> tty8 -> tty7 And then I tested it with another locker like xlocker, it didn't have this issue.

4.19.66-1-MANJARO with Xfce 4.14

@jalovatt Do you have this issue after the same replacement?

kzkn commented 4 years ago

I have also same issue. I use light-locker with lightdm.

Arch Linux uname: Linux daisy 5.2.14-arch1-1-ARCH #1 SMP PREEMPT Tue Sep 10 18:11:49 UTC 2019 x86_64 GNU/Linux light-locker: 1.8.0-2 lightdm: 1.30.0-2

thjwong commented 4 years ago

replace following line: light-locker-command --lock with: dm-tool switch-to-greeter

Where do I make these changes?

rockokw commented 4 years ago

replace following line: light-locker-command --lock with: dm-tool switch-to-greeter

Where do I make these changes?

You make the change in the xflock4 script, located at /usr/bin/xflock4. To find where a command is located, you could run which xflock4

tux-ware commented 4 years ago

@dpint First I should thanks for your solution of this replacement. However I found a strange performance when I type xflock4 (which actually invokes the command dm-tool switch-to-greeter to show a locked screen) and switch to tty8 (which only shows a blank and black background with a cursor) and then switch back to tty7 again, the locker vanished and I can directly operate the OS. The progress is: lock the screen -> tty8 -> tty7 And then I tested it with another locker like xlocker, it didn't have this issue.

4.19.66-1-MANJARO with Xfce 4.14

@jalovatt Do you have this issue after the same replacement?

Hello @QvQQ @dpint and @jalovatt

I am on a fresh Xubuntu 19.10 with XFCE 4.14. The workaround with dm-tool switch-to-greeter worked for me as well, but I noticed another issue with xfce4-screenserver.

When the screensaver is active, but auto-screen-looking is not enabled, sometimes while exiting from screensaver when I move a mouse, instead of going back straight to my desktop, it gets stuck on some light-gray background. I can only move the mouse cursor around, but the whole screen is just plain gray. I tried to click that light gray background after invoking xkill with ctrl+alt+esc key combo, but nothing happens.

When I disable screen server and leave just the screen lock enabled, screen locking works fine (after applying that dm-tool workaround, of course). So I thought that I better uninstall the whole xfce4-screenserver package, as this PC will be used by some older lady and I don't want her to get in trouble, if she turns the screensaver on again.

After I uninstalled xfce4-screenserver package and activated the screen lock, I was able to "lock the screen -> tty8 -> tty7", and it took me straight to the desktop. I can switch back to the lock screen on tty8, or switch to my desktop on tty7 and use it without the password. This happens only when I have xfce4-screenserver package uninstalled. Still it is better to have it like this, then to get stuck completely on the light gray background (after screensaver deactivation).

I hope this gets fixed before 20.04 release, as it is quite a usability bug, that you may bump into many times a day. Can anyone help, so this bug gets some more attention and a proper fix?

Cheers!

sgtcoder commented 2 years ago

I am having the same issue. The dm-tool might work, but it also logs me out of my session. I also have to switch to TTY1 wait, then switch back to TTY7 in order to get the displays to turn back on.