Sometimes (every blue moon!) repeated painting of the contents of the clipboard
into an X Window can occur in Xming (same code as Cygwin/X).
The WM_DRAWCLIPBOARD code calls SendMessage() before processing clipboard
change. Since the SendMessage() function does not return until the receiving
window has processed the message it's not surprising things can go wrong. The
attached path reverses this code order in WM_DRAWCLIPBOARD and if nesting is
detected makes a better stab at correction.
The patch applies to both the monolithic and modular cygwin trees.
Created attachment 5822 [details] [review]
Patch to fix the problem
merged to head, thanks!