I've done extensive testing to determine the nature of this problem.
I'm running Ubuntu-server 22.04 with Xubuntu-core.
This is suppose to be a micro-server, something the clients can go to and leave their complaints which are then emailed to support staff. We expect maybe 3 such interactions a day and maybe 30 if things go badly wrong. So no need for anything big and powerful. It's a 1.7 GHz Celeron N95 with 8G of DDR5 and an 8GB swap space. But it's nice to have a desktop for when I have to see what's going on without needing to lug my laptop along.
If I leave it overnight at the login screen, I can login the following morning. If I'm at the desktop, and it's been idle for some length of time that's less than an hour, the mouse cursor moves about the screen but none of the mouse clicks are recognized, keyboard shortcuts don't work, and pressing the power button doesn't trigger it to shut down. If I want to use the power button to shutdown, I need to press and hold.
HOWEVER, sshd, apache, and cockpit all work. sudo reboot works from sshd and cockpit. Everything works except the desktop.
There are no crash logs. There is nothing in the logs to indicate the source of the issue. The desktop just stops responding.