Lock screen on suspend

Like many others, I have had problems getting the screen to lock on returning from suspending my laptop. There are many threads here and bug reports (just search for "suspend lock").

In my case, I managed to solve the problem by changing two variables using dconf editor:
org.mate.power-manager.lock-use-screensaver - false
org.mate.screensaver.lock-delay - 0
And reboot.

I'm not sure which of these did the trick but I offer the information to others who might be struggling.

I'm running 20.04.4 LTS (Focal Fossa) 64-bit with MATE 1.24.0, all fully updated as of 19.5.2022.

I have the same issue on 22.04, MATE 1.26.0. I tried changing the two variables you mentioned, but unfortunately it looks like this trick doesn't work on 22.04. (At least for me.)

Anyway, I agree it seems that something is bugged.

1 Like

I was able to overcome the issue using a systemd service to invoke loginctl as recommended here:

But it does seem like kind of a kludge. I wish this wasn't necessary.

1 Like

So it turns out, and I have no idea why, I actually need both your solution and the other solution in place for the lock to actually work. I only realized this when I went to remove the edits with dconf-editor, thinking they were unnecessary, and then the lock stopped working again.

I did a little bit of testing, and without lock-use-screensaver and lock-delay set, loginctl lock-sessions doesn't seem to do anything at all, which seems very weird. I'm wondering if I did something to mess up my install because of how painful this has been to get working.

This is still an issue with my system today, I have 2 installations, desktop/laptop and neither require login after suspend

This is still an issue when suspending from UM with fresh installation

I have accidentally come across an easy solution: Do not use for suspending the menu item "Suspend" directly in any of the menu widgets that contain it, but instead use "Shutdown" menu item and then the menu item "Suspend" in the Shutdown dialog. Then your PC will suspend, and after waking up, it will display the password-requesting dialog and the OS and apps will be restored from the suspended mode.

2 Likes

Welcome @VladimirCZ to the community!

I can confirm that there are at least two ways to get the correct behaviour on a fresh install of UM 24.04.1:

  1. Use ⏻ -> Shutdown -> Suspend on the panel, or;
  2. Close the laptop lid.

What doesn't work:

  • Using ⏻ -> Suspend on the panel.
2 Likes

I have submitted the following bug reports - as it appears that the problem lies somewhere between mate-session-manager and the ayatana-indiciator-session:

3 Likes

Having looked through the way ayatana-indicator-session works, I would say this is not just a MATE-specific problem - and it's unlikely to be resolved any time soon.

The solution I went with has already been posted; even if it seems 'kludgey':

1 Like