Revert "Revert "Fix up expanded desktop behaviour.""

This reverts commit fa6f3f41ed40904e9e1115c2bf0d35b84eef02cb.