Recently I upgraded the kernel I was using to the newest available, and everything worked great until the screen locked and I couldn't log back in. At first it was a black screen displaying the top bar with the clock and user name, now it's like the desktop froze even though I still can move my cursor.
Reading all the questions asked here and trying all of the solutions provided the only way I could get back was rebooting (logging through Crtl+Alt+F2)
I have tried
sudo dpkg-reconfigure lightdm changing between GDM and LightDM.
And I tried
sudo chown user:user .Xauthority.
I also tried reinstalling GDM and disabling and/or upgrading the nvidia drivers, as I read that that could have been the problem.*
shell: Gnome 3.18.5
distro: Ubuntu 16.04
Edit: *Just playing around with nvidia releases I discovered that
sudo apt-get install nvidia-current solved the problem but it brought other problems as well.