In 2009, Obama attended a "dignified transfer" at Dover Air Force Base and held a salute for 45 minutes. He did not wear a baseball cap like he was attending a ballgame.
@augieray why did a civilian salute?
@mariejulien Are you being serious? Look up "Commander in Chief".
@Wildflower01 he's still a civilian, depending on the country the military salute is not appropriate even as commander in chief. I don't know for USA.
@mariejulien The President in the US is in command of the armed forces. In other words, he's the highest on the totem pole in the military. Higher than a 5-star General. He salutes.
@Wildflower01 The President in France is in command of the armed forces. Litteraly "chief of the armies". In other words, he's the highest on the totem pole in the military. Higher than a 5-star General. He does not salute. Because he's a civilian and here military salutes are for… well, military.

@mariejulien Looks like it started with Reagan.

"The U.S. military salutes the President as a sign of respect to the Commander-in-Chief, who represents the highest civilian authority over the armed forces. While military regulations require personnel to salute the President, the tradition of the President returning the salute only became standard under President Reagan in 1981."

@Wildflower01 good to know. As you see, it was not so obvious, and not a requirement. Thanks for the follow up!