9

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

4
  • 1
    Very old bug, persisting through the years. askubuntu.com/questions/1364813/…
    – BaTycoon
    Commented Jan 5, 2022 at 14:14
  • 1
    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 ... 🤐
    – matigo
    Commented Jan 5, 2022 at 14:17
  • Seems a duplicate of suspend - Privacy issue when waking up suspended machine Commented Jan 6, 2022 at 4:54
  • 1
    Sadly, it is not. There is no Advanced tab in the screensaver settings nor an option to "Fade to Black when Blanking" 😕
    – matigo
    Commented Jan 6, 2022 at 5:35

3 Answers 3

4

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.

1
  • Interesting, but now xfce4-settings is in version 4.16.2; +1 since it may be usable with some adjustments.
    – Joël
    Commented Jan 15, 2023 at 8:36
3

I had the same problem on Linux Mint 21 (based on 22.04) and have found a solution which works for me. It seems that the problem arises from the support for upower-glib in xfce4-settings as written here. XFCE disabled upower-glib some time back but the Debian and Ubuntu packages are still compiled with support for it for some reason.

To recompile the package, do the following (my package version is xfce4-settings_4.16.2-1ubuntu2_amd64, so your version numbers/architecture might be different depending on the version of Ubuntu you're running):

  1. Enable the deb-src entries for packages. The easiest way is to go through the GUI at Software & Updates → Ubuntu Software and then tick the Source Code box.

  2. Download the source of xfce4-settings:

    mkdir tmp
    cd tmp
    apt-get source xfce4-settings
    cd xfce4-settings-4.16.2
    
  3. Install some generic build dependencies:

    sudo apt-get install build-essential pbuilder
    
  4. Install build dependencies for xfce4-settings:

    sudo apt-get build-dep xfce4-settings
    
  5. Edit the file debian/rules and delete the line that says --enable-upower-glib \. This line normally enables upower-glib support, which we don't want.

  6. Recompile the package:

    debuild -i -us -uc -b
    
  7. Replace the installed version of xfce-settings with the package which we just compiled:

    cd ..
    sudo dpkg -i -B xfce4-settings_4.16.2-1ubuntu2_amd64.deb
    

Keep in mind that this has to be repeated, should the xfce4-settings package get updated sometime in the future. You can run sudo apt-mark hold xfce4-settings to prevent this from happening, you won't get any updates for this package though then.

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .