Fix a bug with dealing with terminated applications.
Make sure screen changes and initial launch cause window layout.
Prevent some unnecessary window resizes.