The last wild part of San Francisco is the Pacific, which bounds the city for five miles at its western edge, abutting Ocean Beach and the gridiron of the Sunset’s pink-green bungalows. All of this is always, as San Francisco mostly isn’t, beset by fog: white, eerie, gracious. They can raise the rents but they can’t dispel the fog. Nor the campfires plugged into the cruising grounds of the dunes—illegal, burning every night.

In the fifth episode of “Looking”—the HBO series about young, aspirational, urban gay men, whose second-season finale airs tonight—two characters stroll along the cracked pavement of the boardwalk. Richie (Raúl Castillo), a soft-spoken Hispanic barber from the East Bay, wants to get hitched; Patrick (Jonathan Groff), a white video-game designer from suburban Colorado, sees marriage mainly as a way to appease his parents. The conversation is never broached again, and Ocean Beach never revisited, but some trace of both clouds the characters through the series; even inland, they stay grainy and gray, as though the camera were flecked with salt. In their San Francisco, the contusions of casual sex are pitted against the banalities of steady dating, and the romantic weather is always bad.

“Looking” is an artifact of a moment when, in the most tolerant regions of the American imagination, the bathhouse has been razed and the single-family home has been built in its place. In 1989, Andrew Sullivan earned progressives’ scorn by suggesting that marriage was a good idea for gays, arguing in The New Republic that it “would foster social cohesion, emotional security, and economic prudence.” In 2015, his logic is inscribed on the pro-marriage banners of the Human Rights Campaign, which sport the “=” symbol that has become the raised fist of the just-like-you gay-rights movement. Among the kind of men portrayed in “Looking,” the opportunity to marry is now settled. The question is no longer whether they are allowed to love but whether they will find the love they seek.

Last season, Patrick ended his tame but affectionate relationship with Richie after enduring—or enjoying; it was hard to tell—an act of ferocious sex with Kevin (Russell Tovey), his already-taken, bulked-up British boss, on the concrete floor of their company’s loft office. At the beginning of this season, Patrick and his two best friends, a washed-up waiter and a washed-up artist, head north for a weekend at the Russian River, lined with the cabins and redwood clearings of orgiastic lore. Patrick says that they are meant to unwind together, “not us and three hundred naked homos crammed in a pool,” but that evening, out in the woods, they share a stash of molly at an open-air dance club and pair off with strangers—the artist with a congenial, H.I.V.-positive bear, the waiter with a young black man, and Patrick with an imposing guy in a mesh cap. The encounters are freightless enough until, as the season progresses, the artist decides that he wants more from the bear than a night of skinny-dipping, the waiter decides that he doesn’t like his San Francisco sugar daddy letting him sleep around, and Patrick—who, that night at the river, sends the mesh cap packing before calling Kevin up from the city—decides that he should replace Kevin’s partner on a permanent basis. Gay bathhouse magic isn’t what it used to be, in other words, if it ever was.

That televised gay angst should have anything to do with committed relationships is a victory for the mainstream gay-rights movement. By the fall of 1974, three years after the first gay cameo on popular American television (the vehicle was the liberal lodestar “All in the Family”), there were a handful of gay characters on prime time. According to “Alternate Channels,” Steven Capsuto’s 2000 book on gay television, “All were rapists, child molesters, or murderers.” Activists lobbied networks to stop depicting gays as criminals and, within a few years, moved on to more subtle forms of otherness. Tropes to avoid, per a 1978 memo from the National Gay Task Force: “Gay men = swishy, limp-wristed, female role, want to be women, transvestites, transsexuals, [i]nstant hilarity. Lesbians = masculine, want to be men. No comic value.” To be promoted: “Person doing a good job—gay cop, business executive, sportsperson, secretary, psychiatrist—mainstream. Gayness just incidental.” Networks began sending scripts to advocacy groups for pre-broadcast review, and a lineage of gay lawyers was born: the dark-suited lead of the first major TV treatment of AIDS, a 1985 movie called “An Early Frost”; the dour Will, of the late-nineties sitcom “Will & Grace”; half of the gay couple on the beloved, Mitt Romney-approved “Modern Family,” which premièred in 2009.

Sexier stuff was allowed, to a point. When, in 1994, Mariel Hemingway turned up as the lesbian Sharon on “Roseanne” and kissed Roseanne Barr, Frank Rich described the moment in the Times as “a small step forward for the stirring of homosexuals into the American melting pot.” Seven years later, Anthony Tommasini railed in the television pages against “Queer as Folk,” a new Showtime series that situated gay male life in a club populated largely by meth addicts and prostitutes: “There is no courtship, no romance, no mystery”—nothing like the “Roseanne” kiss. It was “just fantasy, come-ons, blunt advances, quick acceptance or rejection, and even quicker sex.” (Critiques of “The L Word,” which, in 2005, began chronicling the affairs of a lesbian clique in West Hollywood, followed the same lines.) Nancy Franklin, in her review of “Queer as Folk” for The New Yorker, wrote that “having sex is virtually the only thing its characters do,” but predicted that the show would lead to “better shows with a variety of gay characters beyond the usual stereotypes.” With “Looking,” the prophecy appeared to be fulfilled. Last year, Emily Nussbaum observed that the sex was largely awkward, and just one element of a show that “treats a highly specific circle of gay men with warmth and playfulness, viewing their struggles as ordinary, not outrageous.”

For Patrick, it’s the ordinary that is outrageous. Born in the mid-eighties, he is from the earliest wave of the post-Stonewall, post-plague, post-activist generation—too old to have brought a boy to the prom and too young to have nursed a fantasy of running away to an urban gay utopia. I am also from that group. When I was in high school, “sodomy” was illegal in twenty-five states; when I was in college, marriage became the first publicly sanctioned model for gay relationships. Being gay finally had clear meaning: the toggle of a setting on a dating profile and the wait for a husband. In the meantime, two-thirds of those on Grindr, the smartphone app for gay hookups, wanted only to chat, according to the company’s own surveys. The legal fight wore on for “a right that someone like Patrick isn’t sure he even wants,” as Wesley Morris described marriage equality last year, in his account of “Looking” on Grantland.

Despite its novelty for many gay people, “ordinariness” has long been invoked in efforts to sell gay rights to America. The two couples at the center of Perry v. Schwarzenegger, the successful challenge to California’s 2008 gay-marriage ban, were presented by their attorneys as exemplars of what Alexander Borinsky, writing in n+1 in 2011, called the “new gay”: “hardworking, wholesome, and unambiguously gendered; adorably installed in a long-term relationship; too busy volunteering at church and attending children’s soccer games to have time for deviant behavior.” For decades, gay advocates have been making the same case on television, and Patrick is the latest result.