Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop is visible briefly before lockscreen on resume #231

Open
dairefagan opened this issue Sep 10, 2020 · 5 comments
Open

Desktop is visible briefly before lockscreen on resume #231

dairefagan opened this issue Sep 10, 2020 · 5 comments

Comments

@dairefagan
Copy link

dairefagan commented Sep 10, 2020

Expected behaviour

Whether I suspend from the power menu, a systemctl suspend, or by closing the lid of my Dell XPS 13 9360, when I resume the first thing I will see is the lockscreen.

Actual behaviour

If I resume from suspending by closing the lid, the lockscreen is the only thing I see but if I resume from systemctl suspend or by selecting suspend from the power menu, my desktop is visible briefly fo 1 or 2 seconds before the lockscreen.

Steps to reproduce the behaviour

After a fresh distro install yesterday I was *not seeing a lockscreen on resume until I input today:

dconf reset -f /org/gnome/desktop/screensaver/
dconf reset -f /org/mate/screensaver/
dconf reset -f /org/mate/powermanager/

Suspend with systemctl suspend or from the power menu, wait a few seconds and then resume.

*As reported the lockscreen now displays so I am not reporting the issue with it not doing so.

MATE general version

1.24.0

Package version

mate-power-manager 1.24.1
mate-screensaver 1.24.0-1

Linux Distribution

Ubuntu MATE 20.04.1 minimal

#145
#202

@lukefromdc
Copy link
Member

This sort of issue just seems to keep coming back, and as has been stated in the other issues the fact that we draw a window over all other windows (but X has no way to privilige that window and does not "understand" screensavers) makes it difficult to get this to work absolutely, 100% of the time. Moving the screensaver to another VT might be the only truly reliable fix so long as we are on X11.

@Langlais115
Copy link

Langlais115 commented Apr 11, 2021

This issue is know since a very long time now. I don't know why it's still not fixed as this is clearly a security issue.
Anyway, there are 2 workarounds for this issue:

1 Workaround

Changing the screensaver to blank screen may solve the issue.

2 Workaround:

From the issue 145 opened in 2017

I've found that configuring my system to delay a few seconds before suspending (via systemd) seems to workaround this issue, giving mate-screensaver time to lock the screen before it goes into suspend:

create the file /usr/lib/systemd/system-sleep/sleep.sh

with the contents:

#!/bin/sh
case $1 in
  pre)
    /bin/sleep 2
  ;;
esac

and make the file executable (chmod 755 sleep.sh)

Now, when I close my laptop lid and re-open it, the lock screen appears without showing the contents of my desktop first

@oliverdelancey
Copy link

oliverdelancey commented Jul 9, 2021

Is there any progress on this? I'm running Fedora 34 (X11 because Nvidia) on a Thinkpad P17 where the screen is visible ~4 secs before the lock screen appears. This happens both when suspending via the lid and when suspending in software. I'd be willing to manually modify system files if there is a proven solution.

Note that the above sleep fix doesn't work, at least for me.

@jesse-osiecki
Copy link

we might be able to hook into systemd pre-sleep to run a mate-screensaver-command -l as well. I'm having this problem, so I'll try that and report back

@lukefromdc
Copy link
Member

Changing the screensaver to blank means less code to run, so no surprise if the screensaver window renders faster and thus prevents the desktop from showing. This will be sensitive to the speed of a particular machine however

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

No branches or pull requests

5 participants