Revert "Remove potentially problematic viewport fix"

This reverts commit 366c105981ca1139328ba6920635638f9a869ec2.