You may need to restart your display manager to fix your problem.
11.04 and earlier.
sudo service gdm restart
Ubuntu 11.10 and newer.
sudo service lightdm restart
lightdm
replaces gdm
in Ubuntu 11.10
Ubuntu 15.04 and newer.
sudo service sddm restart
While restarting lightdm restarts the entire display manager, you may be able to resolve the issue by restarting unity or compiz (Unity is a compiz plugin).
Restarting Unity (nohup setsid unity
OR nohup unity --restart
on the CLI OR Alt+F2 and type unity
) restarts the Unity shell.
If that doesn't work, restart compiz with nohup compiz --replace
. You may need to restart unity again after restarting compiz.
Restarting lightdm restarts the entire display manager which is most likely to work but it will also close your running applications. Which you need to do depends on how broken your session is. If you can just restart Unity or Compiz, do that. If that doesn't work, restart lightdm.
The following wiki article has additional information about fixing LightDM issues:
https://wiki.ubuntu.com/LightDM
Doing YourWindowManager --replace
means xfwm4 has already started upon login and you are now stopping it to start a new window manager...that's working but there's a quicker and cleaner way as this guy explains taking kwin as his example.
XFCE starts the window manager specified in /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
or, under xubuntu, in /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
In this file look for the Client0_Command
property and edit its value: <value type="string" value="xfwm4"/>
to <value type="string" value="kwin"/>
(obviously, replace "kwin" with your window manager of choice) You would need to go root. You could also copy and only edit that file in /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
if you want the changes to only affect your userspace.
Because in XFCE it is common for us to save our session while logging out, don't forget to clean your session: Settings Manager->Session and Startup->Session tab->Clear saved sessions
Now you can logout and back in.
Best Answer
The default window manager is called compiz. Open a terminal and type
to get the full path. Type
to see in which packages it is replaced. Unlike what was suggested in a deleted comment, metacity is not responsible for Compiz window decoration, but a Compiz plugin called aptly "Decorations".
If, however, you log in using the "Unity 2D" option, you will be using a different window manager, called metacity.