window border detection