SAN FRANCISCO — On a recent morning at the main public library here, dozens of people sat and stood at computers, searching job-hunting sites, playing games, watching music videos. And some looked at naked pictures of men and women in full view of passers-by.

The library has been stung by complaints about the content, including explicit pornography, that some people watch in front of others. To address the issue, the library over the last six weeks has installed 18 computer monitors with plastic hoods so that only the person using the computer can see what is on the screen.

“It’s for their privacy, and for ours,” said Michelle Jeffers, the library spokeswoman. The library will also soon post warnings on the screens of all its 240 computers to remind people to be sensitive to other patrons — a solution it prefers to filtering or censoring images.

It is an issue playing out not just at libraries, but in cafes and gyms, on airplanes, trains and highways, and just about any other place where the explosion of computers, tablets and smartphones has given rise to a growing source of dispute: public displays of mature content.