He had one, brief glimpse of the stone Pensieve on the desk where he had left it, and then an earsplitting noise made him cry out, thinking of curses and returning Death Eaters and the rebirth of Voldemort —
But it was applause. All around the walls, the headmasters and headmistresses of Hogwarts were giving him a standing ovation; they waved their hats and in some cases their wigs, they reached through their frames to grip each other’s hands; they danced up and down on the chairs in which they had been painted; Dilys Derwent sobbed unashamedly; Dexter Fortescue was waving his ear-trumpet; and Phineas Nigellus called, in his high, reedy voice, “And let it be noted that Slytherin House played its part! Let our contribution not be forgotten!”
I didn't understand the sentence in bold, from the para given above. Grasped each other's hands? Danced on their chair? What did they do, what action was performed over there? Kindly explain.
Thanks in advance.