Set flag correctly when able to connect to the X server.