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.