Fix fullscreen issue on beta branch

Cherry-picked from master.