Fix edge case that caused dialogs to rremain hidden after updating layout.