The Holy See was only given sovereignty over the part of Rome that would subsequently be known as the Vatican City in 1929, after the signing of the Lateran Treaty with Italy. Prior to then, Law of Guarantees, passed in 1871, made the Pope a citizen of Italy while simultaneously safeguarding his rights to do things like receive and send foreign embassies.
The Papacy, unsatisfied by the Law of Guarantees, limited Papal appearances at St. Peter's Basilica and mostly confined itself to the Lateran Palace and the Vatican Complex, the Pope's historic residences in Rome. While certainly a great source of political tension (and inconvenience: the Papacy never recognized the Italian state, while the Italian state did not grant legal status certain religious ceremonies, notably weddings) there was nothing physically stopping the Pope and his staff from sending out attendants to go grocery shopping (much as they continued to do after the Lateran Treaty) or travel the three miles across the city between the two buildings. The highest tier of the Roman Aristocracy, many of whom held appointments at the Papal Court, were in a similar situation: known as the "Black Nobility," they were not impeded in their travel between their urban residences and the Lateran Palace, or anywhere else they should desire to go.
So although the Papacy and its court did limit its movements within Rome, there was nothing physically impeding this movement, save for the occasional anti-clerical mob. However, even here the Italian authorities were more than willing to protect the Pope. This seems to have troubled the Holy See: it would be very easy for the not insignificant secularist faction in the Italian government to pressure the magistrature to imprison the Pope, or worse, instruct the police to stand aside as an angry mob threw him in the Tiber. However, by and large the practicality and usefulness of such a stunt made it a less than desirable outcome, and indeed the secularist line was instead to ignore the Papacy, while the Catholic faction in Parliament vehemently defended it. The official line of the Italian state was that the Pope was most certainly not a prisoner in the Vatican, and recognized his status as head of the church; the implication being, "What more could you ask for?"
The Papacy, never fully acknowledging the extent of secularist sentiment in Italy, argued that the Papacy was a moral prisoner in the Vatican. If you'd like to read more, Prisoner of the Vatican by David I. Kertzer at Brown is a very good and thorough overview of the entire dynamic, both during and after the unification process.