Use a more simpler and reliable viewport detection method.