[Fix] Metacity vs gnome-panel shadow race
Using the classic desktop with metacity on Ubuntu 11.04, I got sick of having to reload metacity every time I logged in just so gnome-panel would get a nice drop shadow from metacity’s compositing manager. This post contains a really quick fix to make the shadow work and get the panel to look pretty again!
This is my temporary workaround for this bug: LP #269670
As root, create a new file in /usr/bin named something remember-able along the lines of metacity. I chose /usr/bin/metashitty. Open it up in your favorite editor, as root, and paste the following short script and save it:
#!/bin/bash sleep 1 # Let gnome-panel have 1 second to register metacity $* &
Next, give the script executable privileges:
sudo chmod 775 /usr/bin/metashitty
Now run gnome-session-properties from a terminal or by pressing Alt+F2, press Add and in the Command text field, enter the following:
metashitty --replace
And then press save and close the window. (You can give it a title and description if you wish)
Now if you log out and back in, the shadow should appear below the gnome-panel. If it doesn’t, you need to increase the number after sleep in the script we wrote earlier. Increase it by 1 each time until the shadow appears as soon as you log in. If the shadow appears too late, you need to decrease the number.

