Score:5

Xubuntu - Desktop Visible After Suspend Before Lock Screen

in flag

Xubuntu 21.10 is a pretty solid system with a lot going for it. That said, there are a few little things that can make a person scratch their head. One issue that I'm facing is that the desktop (and any open applications) will be shown for almost half a second before the lock screen kicks in when resuming from suspend. There was a bug report filed a few years back with a fix apparently released in 2020. Unfortunately, this problem still persists.

A post on the XFCE forums proposes uses a systemd hook to pause for a second on resume:

#!/bin/sh
case $1/$2 in
  pre/*)
    #enter sleep
    ;;
  post/*)
    #exit sleep
    sleep 1
    ;;
esac

While this does reduce the amount of time the desktop is visible by a fraction of a second, people with eagle eyes will still be able to read whatever might be displayed on my screen. Changing the sleep value from 1 to something higher does not resolve the issue.

Is there something else I could do to have the screen blank out before entering sleep so that the first thing a person sees when accessing the notebook is the lock screen?

Hardware:

Lenovo ThinkPad X1 Carbon
CPU: Intel Core i5-7200U
RAM: 16GB

OS:

Xubuntu 21.10
Kernel: 5.13.0-22-generic

BaTycoon avatar
mm flag
Very old bug, persisting through the years. https://askubuntu.com/questions/1364813/after-suspend-on-resume-ubuntu-briefly-shows-content-of-session-before-display/1364820#1364820
in flag
Yeah, I've seen similar posts and it's not unknown to the Xubuntu team. Just hoping that someone has a solution they haven't yet shared, as XFCE is starting to grow on me after many years of Gnome ...
vn flag
Seems a duplicate of [suspend - Privacy issue when waking up suspended machine](https://askubuntu.com/a/454295/349837)
in flag
Sadly, it is not. There is no Advanced tab in the screensaver settings nor an option to "Fade to Black when Blanking"
Score:3
cn flag

I suffered from this for years. Most recently in Xubuntu 20.04 with xfce4-screensaver installed, and despite "lock screen when going to sleep" enabled in power management. When I resumed from suspend, I often found what looked like an unlocked screen, with my desktop and mouse visible. But in fact, it was still locked, the unlock screen was merely invisible and I had to blindly punch in my password. Annoying and disconcerting.

Thanks to hslin's great tip regarding upower-glib, this is now fixed, but I used what for me is an easier way to recompile xfsettingsd:

First, ensure you don't have any upower-glib dev files installed -- you can search in Synaptic. You likely won't have any. The alternative is to disable its inclusion during compile, but I didn't need to. Then, grab the code from Github, and check out tag v4.14.4 (the last version in the 4.14 series, and the last supported by the libs installed in Xubuntu 20.04):

git clone https://gitlab.xfce.org/xfce/xfce4-settings.git
cd xfce4-settings
git checkout xfce4-settings-4.14.4
./autogen.sh

Naturally, you'll need build-essentials, and several other dev libraries, but the required versions should all be available with apt (or just search with Synaptic). Install them one by one until configure successfully completes. Make sure it reports that upower support is disabled. Then simply:

make
sudo make install

Open a new terminal, and run xfsettingsd -V to check the newly compiled version has been successfully installed. It should be 4.14.4 (the current default in *ubuntu 20.04 is 4.14.3). Kill your existing xfsettingsd process and relaunch it, or just call xfsettingsd --replace.

That's it. Now resume should always immediately show the lock screen, and never a glimpse of the desktop.

Joël avatar
pk flag
Interesting, but now `xfce4-settings` is in version `4.16.2`; +1 since it may be usable with some adjustments.
Score:2
ps flag

Just to add a bit to the previous post from hslin: for my Xubuntu 20.04 with xfce4-settings-4.14.3, in step 5 I had to add --disable-upower-glib \ to debian/rules.

That solved the problem for me.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.