Fix #10227 and simplification and optmization of defaultDisplay helper