Camera Len's Aspect Ratio Changes When Switching Between Applications

I’m using macOS 14.1 and when I use command tab to switch between applications the aspect ratio changes. The aspect ratio does not change when I don’t set the FOV for the camera lens. I am not resizing the screen. I want the aspect ratio to stay static.

def __init__(self):
    ShowBase.__init__(self)
    self.disableMouse()
    horz=80
    vert=60
    self.camLens.setFov(horz,vert)
    self.taskMgr.add(self.checkAspectRatio, "checkAspectRatio")
def checkAspectRatio(self,task):
    print(self.camLens.getAspectRatio())
    return Task.cont