Change the way screen dimensions are retrieved