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

This reverts commit 2e58535c5593735a3764e7732e5043b58a167114.