Upstream commited changes for window manager freezing fix.

This is the upstream version as it will be implemented (presuming it works).
Patch the MakeDistribRelease.sh script to be a little more sensible.