@kholford is right – "killall Dock" does fix the problem.
I made a LaunchAgent that runs that command every time you log in. Doing it this way, using launchctl, is faster than the AppleScript/System Preferences trick. The desktop only flashes for perhaps half a second before the dock and Mission Control open back up (properly).
Make a new text document and paste this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Go to save the file. When a window pops up asking where to save it, press Command+Shift+G and enter ~/Library/LaunchAgents.
Name the file something like com.sndesrever.restartdock.plist and save it in this folder.
Now every time you log in things will look nice, as Macs are supposed to.
Hope this helps!
Hi there, found the same issue on our iMac - late 2010 running ML 10.8.2.
killall Dock and/or removing the plist file removed this issue at least temporarily for me as well.
My 2cents: I made a backup of the plist and then ran killall Dock. Then I used Plist Edit Pro to open the original backed-up plist file and the new one just generated by the system. In the new file I deleted the two keys "persistent apps" and "persistent others" and drag-and-dropped the same two keys from the back-up plist into the new one. With killall Dock you restart your Dock again and voilà all your apps are back in place on the Dock.
Plist Edit Pro can be used without purchasing it for some time. After that you get some delaying welcome screen. Alternatively, you can use "Text Wrangler" or the Xcode editor, both are completely free.