Howto recover non responsive desktop
How to recover your desktop without rebooting
Occasionally you may encounter a program that refuses to go away when you are trying to close a window. Thankfully, there is a command to handle this. The "xkill" command is used to terminate a hanging window that refuses to close. To the use the xkill command in Ubuntu, simply open a terminal screen and type the command "xkill". You should now see a a special icon appear in the shape of a "X". Now all that is required is for you to move the "X" over the non responding window and click button one on your mouse.
Kill all Programs and return to Login Screen
If you ever encounter a situation where your desktop stops responding completely, you can switch to a terminal view and terminate all processes owned by you. Be warned, you will loose any unsaved work! To exit to a terminal screen from your desktop, simply press the keys: Ctrl + Alt + F1 Now at the terminal issue the command: kill -9 -1
All process now owned by you will be terminated and you will be taken back to your Login Screen where you can login again.
Reboot when system is completely locked
If your system has completely locked (frozen), you may still be able to reboot without having to resort to hitting the Power Button. You may be able to issue a special key sequence that allows you to reboot!.
Magic SysRq Key
REISUB commonly knowns as "Reboot Even If System Utterly Broken". You can also remember this sequence of key presses as backwards they spell "BUSIER"
The above key sequence can be entered by holding down the Alt + SysRq keys and pressing the following keys: R E I S U B
R = Take control of keyboard back from X
E = Send Terminate signal to all processes except for init process
I = Send Kill signal to all processes except for init process
S = Sync All mounted filesystems
U = Remount all filesystems as Read Only
B = Reboot
Allow several seconds between each keypress