My approach above is not bullet-proof
: I just experienced an instance when the setting for the Lid in Power Manager was to "Switch off Display", and logind was set to False as explained earlier, and still closing-opening the lid made the screen "frozen".
But,
here's another solution that, from my initial tests, preserves auto-lock on Lid close without "freezes".
UPower are the "eyes" of Xfce's power manager for Lid opening / closing. (I confirmed this in a few tests).
If you disable that by:
sudo nano /etc/UPower/UPower.conf
IgnoreLid=true
then after saving:
sudo systemctl restart upower.service
(or reboot laptop)
then the options for "Laptop Lid" in Power Manager's "System" tab vanish.
Now if Xfce's Settings Editor option for "xfce4-power-manager" -> "logind-handle-lid-switch" are set to FALSE, then the Lid is totally ignored. (Except that, on close, the screen power still turns off, at least on my laptop.)
But if you set that to TRUE (check mark), then taken action is determined by what you have in "/etc/systemd/logind.conf" for HandleLidSwitch and friends.
(To effect changes in that file, need:
sudo systemctl restart systemd-logind.service
or reboot the laptop).
The setting can be one of: "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", and "lock" (see man logind.conf).
