make existing graphics error checks compile-time optional and add check in Window frame