Better viewport detection.