This simple tutorial will show you how to restart unity and unity-2d in Ubuntu.Normally we need to restart unity only when meet a “no response” problem.If restarting unity can’t fix your issue,maybe you need to try restart your X display manager.
Restart unity without restart compiz
You can press ALT+F2 ,then type “unity” ,then click ENTER to restart unity.
Or you can run below command in terminal to restart unity
Restart unity by restarting compiz
setsid compiz --replace
Restart Unity 2D
Run below commands in your terminal to restart unity 2D
pkill unity-2d-shell pkill unity-2d-panel
Restart X display Manager
If above methods can’t fix your issue,you may need to try restart your X display manager.
Note:All opened applications will lost
sudo -s setsid service lightdm restart