I just came back to Ubuntu after quite some time. After installing 22.04, I'm running into a weird issue that I can't seem to find a resolution for.
Whenever a display setting changes, I get logged out. It happens when I disable or enable a display, and also when I change the primary display. That in itself isn't a big deal since I'm not changing display settings very often. What is really frustrating though is that I also get logged out when the machine is idle and Ubuntu attempts to put the screens to sleep.
I've tried disabling all extensions, but that hasn't helped. I found an outdated question that suggesting using compiz, but it looks like compiz is no longer in the repos and I'm hesitant to try such an outdated solution.
After hunting for quite some time, I found another outdated answer that pointed me in the direction of what turned out to be a good solution.
In short, the desktop stack was crashing, forcing a logout. I just needed to switch to the latest NVIDIA drivers.
I followed the instructions in this article to do so.
They suggest two alternate ways:
GUI
Command Line
ubuntu-drivers devices
driver : nvidia-driver-510 - distro non-free recommended
sudo ubuntu-drivers autoinstall
OR install the specific driver listed in the previous step like thissudo apt install nvidia-driver-510
sudo reboot
I used the GUI method, but I also used the first command in the command line option to verify that the highest numbered one in the GUI was also the recommended driver for my specific device.