Detect screen dimensions _before_ attaching to the server.