When my PC is idle, it closes everything and logs me out

When my PC idles, it appears to suspend but that closes everything and seems to log me out too, so I think it goes to the screen locker and then, after some unknown time, it suspends but immediately wakes up, so when I return, I’m in front of the logging screen and everything is closed, so I basically lose anything I’ve been doing.

If I manually suspend my PC, it closes everything, logs me out, and then suspends to RAM until I use my keyboard or mouse, which is different from what I get when idling, because instead of staying suspended, it wakes up immediately, as I mentioned previously.

When I activate the idle inhibitor (the eye in waybar), my PC remains awake, preventing me from losing my work, but the screen locker wouldn’t work.

I remember changing some power-saving/ACPI settings in the BIOS, but I’m not sure if it’s related. (My BIOS is bugged and I would like to avoid touching it)

My bad. It was, indeed, some setting in the BIOS that was causing this behavior. Not sure which setting.

EDIT: I still have this problem. I’m not sure if it’s a BIOS settings or not that causes this. It’s inconsistent; sometimes it works, but most of the time it doesn’t.

How did you fix it then?

I was mistaken. I’m not sure if this is caused by a BIOS setting or not. Suspend mode used to work properly, but I changed some ACPI BIOS settings and this problem appeared around that time.

It’s inconsistent; most of the time it closes everything, logs me out, and then wakes up, but occasionally it works properly and displays the screen locker and that’s it.

EDIT #1: Actually, it’s consistent; if I open any program and suspend, it closes everything, logs me out, and then suspends until I wake it up by pressing a key, but if I don’t open any program, the screen locker appears, suspends but doesn’t close anything or logs me out, and I can wake it up fine. Weird.

EDIT #2: After checking and testing every ACPI setting in the BIOS, I can say for sure, that it’s not the BIOS, or shouldn’t be unless it’s caused by other setting that’s not in the ACPI section. This behavior is the same independent of the suspend mode (S1 or S3).

1 Like

After testing several stuff, it seems it’s swaylock that’s causing this problem.

Just executing swaylock in a terminal causes this behavior of closing everything and logging me out into a new session. I think something that swaylock executes is making the session crash because the latest version is 1.7 which was released in november, and this problem is somewhat recent for me.

EDIT #1: This is really weird. Using systemctl suspend causes the problem but as I said before, it actually suspends my PC, while swaylock doesn’t suspend my PC. This could explain why waiting for my PC to be idle has a different effect (it stays awake) than suspending my PC manually. I’m not sure if it’s swaylock or something else that’s causing this problem.

EDIT #2: Uninstalling swaylock “solves” the problem. I created a Github issue.

1 Like

Another solution if you don’t want to uninstall or stop using Swaylock is to change to a workspace that has no program open, this way activating Swaylock won’t crash your Sway session.
Also, you can still activate Swaylock if the program that you are focused on is Alacritty.

2 Likes