The next challenge, gay activists say, is to lobby parliament to repeal the law. “Freedom has to be fought for. The vigilance has to be eternal,” said Ashok Row Kavi, one of the first gay men to come out publicly in India, in 1986, and chairman of the Humsafar Trust, which provides H.I.V. and AIDS health services. “You never know who will stamp on your rights.”

With the ban back in force, it meant that this year, the film festival, while legal — organizers have a permit from India’s Ministry of Information and Broadcasting — showed on-screen relationships that involve illegal acts. The festival sponsors included IBM and the Indian conglomerate Godrej, and mainstream publications such as The Hindustan Times, The Mumbai Mirror and The Hindu promoted the event in their pages.

Image The filmmaker and Kashish festival director Sridhar Rangayan. Credit... Atul Loke for The New York Times

Among the 28 Indian films screened this year at Kashish — which means “allure” in Urdu — were Mr. Rangayan’s “Purple Skies,” a documentary about the challenges of being lesbian, bisexual and transgender in India; as well as K.R. Devmani’s “Meghdhanushya,” or “Color of Life,”about a boy growing up gay in a conservative Gujarati family. Prince Manvendra Singh Gohil, a gay prince from Gujarat who came out a few years ago, provided a commentary at the beginning and end of “Meghdhanushya.”

“Cinema is a very important tool for communication,” the prince said in a telephone interview. “A lot of people who act in films are our role models. We get inspiration from them.”

Other movies from the subcontinent included Visakesa Chandrasekaram’s “Frangipani,” about two men and a woman in a secret love triangle in their remote village in Sri Lanka. A special showcase of Indian shorts included Pradipta Ray’s “Eidi,” or “The Gift,” about a closeted gay man who returns to his hometown to reunite with a close friend, a transgender activist, leading him to confront his demons.