If getting the display index of the existing window fails, fallback to the default display size instead of falling back to 640x480. emscripten r_mode -2 worked on window creation but vid_restart fellback to 640x480.