Improve the pre-existing window check.