logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

mono-5.12-try-catch.patch (1267B)


  1. diff -ur mono-5.9.0.398/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs mono-patched-5.9.0.398/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
  2. --- mono-5.9.0.398/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs 2017-11-17 18:12:57.000000000 +0300
  3. +++ mono-patched-5.9.0.398/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs 2017-12-06 06:24:45.067519852 +0300
  4. @@ -2810,14 +2810,21 @@
  5. internal override object ClipboardRetrieve(IntPtr handle, int type, XplatUI.ClipboardToObject converter)
  6. {
  7. - XConvertSelection(DisplayHandle, handle, (IntPtr)type, (IntPtr)type, FosterParent, IntPtr.Zero);
  8. + try
  9. + {
  10. + XConvertSelection(DisplayHandle, handle, (IntPtr)type, (IntPtr)type, FosterParent, IntPtr.Zero);
  11. - Clipboard.Retrieving = true;
  12. - while (Clipboard.Retrieving) {
  13. - UpdateMessageQueue(null, false);
  14. - }
  15. + Clipboard.Retrieving = true;
  16. + while (Clipboard.Retrieving) {
  17. + UpdateMessageQueue(null, false);
  18. + }
  19. - return Clipboard.Item;
  20. + return Clipboard.Item;
  21. + }
  22. + catch (Exception ex)
  23. + {
  24. + return null;
  25. + }
  26. }
  27. internal override void ClipboardStore (IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter, bool copy)