WindowController: minor optimization