Last Valentine’s Day, a year ago this Thursday, classes were wrapping up at Marjory Stoneman Douglas High School when a former student with a semiautomatic rifle murdered 17 people and wounded 17 others.

It so happens that this Wednesday, the House Judiciary Committee will move to advance legislation requiring background checks on all firearm sales. The killer in the Parkland, Fla., school massacre passed such a check, but this measure would close a loophole exploited by other killers that exempts unlicensed gun sellers from conducting background checks. Support for such a change is overwhelmingly popular, even among gun owners. The bill has an excellent chance of passing the Democrat-led House. Its prospects in the Senate, controlled by the Republican majority leader, Mitch McConnell, are bleak.

Even so, the very emergence of this bill is a reminder of how the gun debate has shifted since President Trump took office — and not in a direction that Second Amendment crusaders might have hoped. Politically, financially and legally, the gun-rights cause and, more specifically, the lobbying juggernaut that is the National Rifle Association have not fared well in the Trump era. If this trend continues — or accelerates — it could wind up being a rare silver lining to Mr. Trump’s presidency.

Some of the challenges facing the gun lobby are not specific to Mr. Trump. A gun-loving president always makes a less effective boogeyman than a gun-skeptical one. In that way, President Barack Obama was good for the gun-rights cause — and it was perhaps inevitable that, having labored to get Mr. Trump elected, the N.R.A.’s fund-raising would taper off. In 2017, the group’s revenues dropped by $55 million, or 15 percent, o ver its 2016 haul, driven largely by a decline in member dues. Combined with its heavy spending in the 2016 campaign, the group now finds itself in a deep financial hole , in debt to the tune of $31.8 million.