compiz and metacity — how to replace the current window manager 

In this post I will show how to switch between compiz and metacity window managers using shell commands as well as a GUI tool. compiz is a window manager that uses 3D graphics acceleration via OpenGL. compiz is quite popular because it has matured somewhat and it produces eye-candy desktops. However, they are situations where running a window manager other than compiz is more desirable. One reason for this is the lack of OpenGL capabilities on older computers. Another reason is that some of the compiz's visual effects can interfere with full-screen applications, such as games. For this reason, gamers often tend to switch off compiz prior to starting games. The reason why I replace compiz with another window manager, namely with metacity (the default GNOME window manager) is that screenshots taken under compiz using gnome-screenshot lack window decorations! I have experienced this under both Fedora and Ubuntu. Since screenshots without window decorations don't look quite as good as with the decorations, I use the a GUI tool called desktop-effects to enable and disable compiz when needed. Here are example screenshots of desktop-effects tool without window decorations and with window decorations, respectively.

Screenshot: Desktop Effects with Compiz Enabled           Screenshot: Desktop Effects under Metacity (i.e. with Compiz Disabled)

It is also possible to disable compiz from the Linux shell. The following command is used to replace compiz window manager with metacity window manager.

metacity --replace &

While the following command can be used to restore the compiz window manager.

compiz --replace &

The above commands can also come in handy if for whatever reason compiz has crashed and the window decorations have disappeared. For instance, on my Fedora Core 6 box I often get the following error.

The program 'gtk-window-decorator' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadLength (poly request too large or internal Xlib length erro'.
(Details: serial 104726 error_code 16 request_code 154 minor_code 35)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

To get around this I replace the crashed window manager with compiz as described previously.


Did you find the above information useful and interesting? If so, please support this site by using the blog directory links at the bottom of this page. Thanks for your support!

If you have any Linux related problems or questions then please feel free to post them on our Linux Forums: http://linux.dsplabs.com.au/forums.




VPS Hosting Referral Code DZZCC3

Add me to Technorati Favorites Vote for me on Blog Catalog

2 Responses to “compiz and metacity — how to replace the current window manager”

  1. Birkopf Says:

    I have a bit of issue with Compiz and it's "complications" on Linux Mint Katya. Straight after install I need to downgrade compiz and never use it, otherwise it will be crashing my applets (everything on the right bottom side, where the clock is).

    I managed to keep my system without issues for two months now, and today old issue: Mint starts and all my icons as well as graphical settings are gone, meaning - reversed to default gnome icons.

    I was wondering if you ever experienced anything like that and where to look for clues, because logs don't contain anything.

  2. Mohammad Rafiee Says:

    hi,
    I have another problem too when I want to change my window manager to comiz the following error ocures i do not know what to do

    mohammad@itrc-rafiee:~$ compiz –replace &
    [2] 4070
    mohammad@itrc-rafiee:~$ Checking if settings need to be migrated …no
    Checking if internal files need to be migrated …no
    Backend : gconf
    Integration : true
    Profile : default
    Adding plugins
    Skipping upgrade com.canonical.unity.unity.01.upgrade
    Skipping upgrade com.canonical.unity.unity.02.upgrade
    Initializing core options…done
    Initializing bailer options…done
    Initializing detection options…done
    Initializing composite options…done
    Xlib: extension "GLX" missing on display ":0.0".
    Xlib: extension "GLX" missing on display ":0.0".
    Xlib: extension "GLX" missing on display ":0.0".
    Compiz (opengl) - Fatal: glXCreateContext failed
    Compiz (bailer) - Info: Ensuring a shell for your session

    (metacity:4076): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

    (metacity:4076): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

    (metacity:4076): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

    (metacity:4076): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
    ^C
    [1]- Done metacity –replace
    [2]+ Exit 1 compiz –replace

Leave a Reply