This change adds a timeout to the Clipboard.Enumerating loop, making a
hang less likely. This fixes Novell bug #674098
(https://bugzilla.novell.com/show_bug.cgi?id=674098).
while (f != null) {
XConvertSelection(DisplayHandle, CLIPBOARD, (IntPtr)f.Id, (IntPtr)f.Id, FosterParent, IntPtr.Zero);
+ var timeToWaitForSelectionFormats = TimeSpan.FromSeconds(4);
+ var startTime = DateTime.Now;
Clipboard.Enumerating = true;
while (Clipboard.Enumerating) {
UpdateMessageQueue(null, false);
+
+ if (DateTime.Now - startTime > timeToWaitForSelectionFormats)
+ break;
}
f = f.Next;
}