Fixing XFCE lock screen bug in Ubuntu 23.04 Lunar Lobster

There’s a bug in the latest version of Ubuntu, whereby the XFCE4 lock screen repeatedly crashes. It’s already been fixed upstream in version 4.18.0, but as yet a fix has yet to be backported to Ubuntu. The fix is fairly simple, so I applied it to the current Ubuntu package and rebuilt it. Below are notes on how to do that.

First, edit your apt sources list to enable source download. Make sure that /etc/apt/sources.list includes the following line, uncommented (leave the other lines unchanged):

deb-src http://archive.ubuntu.com/ubuntu/ lunar universe

Next, make sure that you’ve got all of the required prerequisites:

sudo apt update
sudo apt-get build-dep xfce4-screensaver
sudo apt install devscripts

Then download the package source (you don’t need root privileges to do this):

apt-get source xfce4-screensaver

This will create a folder xfce4-screensaver-4.16.0 in your current directory. Apply the patch from https://gitlab.xfce.org/apps/xfce4-screensaver/-/merge_requests/22/diffs to the source file src/xfce-bg.c. Then recompile the package (to apply the changes from the patch) and update the changelogs (the .deb file won’t build if you don’t). Again, root privileges are not needed. When running dch and dpkg-source you’ll be prompted to input some details about the changes. These aren’t critical since the package is not for official use. The argument bug22 for dch is arbitrary, you can replace it with anything. It’s just there to distinguish your changes from the unmodified base package from the official repo.

cd xfce4-screensaver-4.16.0/
./configure
make
dch --local bug22
dpkg-source --commit
debuild -us -uc

Check the output of each step for any errors. Assuming that there were none, you should now have a compiled .deb package xfce4-screensaver_4.16.0-1bug221_amd64.deb in your starting folder. (By that I mean, if you ran apt-get source in /home/yt and it created a folder /home/yt/xfce4-screensaver-4.16.0 then the resulting .deb package will be at /home/yt/xfce4-screensaver_4.16.0-1bug221_amd64.deb. You can now install it:

sudo dpkg -i xfce4-screensaver_4.16.0-1bug221_amd64.deb

Now try locking the screen. If all went well, it will lock successfully and the bug will be gone.

I’m sure that this bug will soon be backported to Lunar and pushed out to the official repos. However, I use the lock screen many times each day and this bug is very disruptive, so I decided to put in a temporary fix.

References

Comments

Many thanks for documenting, this fixed the really annoying issue with the screensaver and lock screen I was experiencing. Lets hope the temporary package will be over written when the fix comes into upstream. Thanks again

Add new comment

CAPTCHA