They went on to cast mostly nonprofessional Lebanese actors from the same neighborhoods, most of whom had known only the privations the film depicts. They changed the apartments and streets where they filmed as little as possible.

The film’s star, Zain Al Rafeea, is a young Syrian refugee from a poor family who Ms. Labaki said had grown up largely on the streets, developing an eye-watering fluency in profanity that topped even that of his character, whose every third word seems to be a curse. (The United Nations resettled the family in Norway last year; Ms. Labaki said Zain was adjusting well. In fact, Ms. Labaki’s team has helped all the young children in the film enroll either in schools or part-time classes since the end of filming.)

None of this is Ms. Labaki’s usual milieu.

“This is happening five minutes away from a completely different life,” she said on a recent afternoon as her Land Rover jounced from the well-groomed streets of Achrafieh, where she lives and works, to the hardscrabble neighborhood called Nabaa, where she shot the bulk of the film. Garbage littered the sidewalks. Electrical wires sagged overhead; laundry slumped from balconies. Cockroaches trundled by Ms. Labaki’s gray Converse sneakers.

As Ms. Labaki got out, people hung out from balconies or waved from corner stores to congratulate her — “Mabrouk!” — on the Oscar nomination.

It was Ms. Labaki’s own ignorance about places like Nabaa, she said, that generated the film’s shock-and-dismay approach, which put off some reviewers.

“You know it’s happening,” she said, “but it’s shocking to see how unbearable it is. It’s different to be inside of it.”