President Barack Obama. (Pablo Martinez Monsivais/AP)

When President Obama arrived in Oklahoma City on Wednesday night, a vulgar sight awaited him: about 10 demonstrators across the street from Obama’s downtown hotel waving Confederate battle flags as the presidential motorcade pulled up.

Such a greeting of the nation’s first black president would have been appalling under any circumstance. It was all the more repugnant because of what it followed — the flag’s importance to the accused killer in last month’s South Carolina church massacre — and by what it preceded: Obama’s visit to a prison Thursday to showcase the problem with sentencing policies that have filled the nation’s prisons with nonviolent offenders who are disproportionately African American.

“[P]eople of color are more likely to be stopped, frisked, questioned, charged, detained,” he told the NAACP this week. “African Americans are more likely to be arrested. They are more likely to be sentenced to more time for the same crime.” With one in 35 black men behind bars (versus one in 214 white men), “around one in nine African American kids has a parent in prison.”

Oklahoma was just the latest reminder of how little progress has been made in what was naively greeted with Obama’s election nearly seven years ago as “post-racial America.” In May, Obama joined Twitter — and was met by a flood of racist tweets. In June, a gunman killed nine people at Charleston’s Emanuel African Methodist Episcopal Church. The suspect had allegedly posed with the Confederate battle flag and posted a racist manifesto online.

This month, just as South Carolina was finally taking down the Confederate battle flag, Republicans in Congress proposed protecting the flag on federal lands, and protesters greeted Obama with the flag in Tennessee as well as in Oklahoma. Meantime, Donald Trump’s popularity among Republicans has surged since he began his campaign of racially-charged rhetoric on immigration.

Following an endless stream of police violence against unarmed black men, it’s enough to drive one to despair. The gloom comes through in a deeply pessimistic new book, “Between the World and Me,” in which the Atlantic’s Ta-Nehisi Coates holds out little hope for white Americans, who deceive themselves by living an idyllic “dream” of prosperity made possible by structural racism. “The plunder of black life was drilled into this country in its infancy and reinforced across its history, so that plunder has become . . . a default setting to which, likely to the end of our days, we must invariably return,” he writes.

Of white Americans, he advises: “[D]o not pin your struggle on their conversion. The Dreamers will have to learn to struggle themselves, to understand that the field for their Dream, the stage where they have painted themselves white, is the deathbed of us all.”

But the recent ugliness has also coincided with a change in Obama’s public approach to race. Obama had been shy about race for much of his presidency, and when he did speak, as The Post’s Janell Ross noted this week, he would often “lecture black America about its behavior.” Now, she wrote, Obama may sound “something like the black president some white Americans across the political spectrum feared (or hoped for).”

I’m one of those white Americans who had hoped for it. It’s not Obama’s job to end racism, and he is probably in a no-win position on race (as illustrated by his “If I had a son, he’d look like Trayvon” Martin remark) but I’m buoyed to have the president speaking as loudly as the haters.

In a June 22 podcast with comedian Marc Maron, he said ending racism is “not just a matter of it not being polite to say ‘nigger’ in public.” On Tuesday before the NAACP, he spoke of the “legacy of hundreds of years of slavery and segregation, and structural inequalities that compounded over generations.” In between, on June 26, came his eulogy in South Carolina — perhaps the best rhetoric of his presidency, but also a call for action over words. “Every time something like this happens, somebody says we have to have a conversation about race,” he said. “We don’t need more talk.”

What we need, for one thing, is the sentencing reforms he spoke about this week. As more nonviolent drug offenders (often black) have been put away, the United States now has 5 percent of the world’s population but 25 percent of its prisoners. The issue has Republican support, which raises the possibility of rare late-term legislative achievement.

Nobody thinks such a law will erase racism. But, as Obama said this week, “If we keep taking steps toward a more perfect union, and close the gaps between who we are and who we want to be, America will move forward.”

It’s the perfect response to the Confederate flag wavers.

Twitter: @Milbank

Read more from Dana Milbank’s archive, follow him on Twitter or subscribe to his updates on Facebook.

Read more on this topic: