On my system, Ubuntu freezes occasionally. The entire display becomes unresponsive - the mouse still moves but nothing happens on click, and with the keyboard I can press
Ctrl+Alt+F1 to go to a login prompt.
When I log in from the prompt, it appears all my programs are still running as normal. Yesterday for example I was converting some videos and running
top showed the
avconv process still running. I left it going for several hours and eventually it had completed the task perfectly. (What actually appeared to cause the freeze was opening Transmission from the notification area, but killing the process from the command line didn't make the system responsive again.)
Anyway, after reading through this question it seemed like restarting the GUI was the way to go. So I ran
sudo service lightdm restart but it closed all the programs down when logging out.
So for future use, is there a way to restart only the GUI and go back to exactly where I was? Everything else in the linked thread is about rebooting or restarting the OS.