From d1c2f2c23ae1d60897129ee84d3c07dc5bc9caf7 Mon Sep 17 00:00:00 2001 From: MattEqualsCoder Date: Tue, 24 Oct 2023 23:49:41 -0400 Subject: [PATCH 1/2] Fix copy to clipboard issue --- src/Randomizer.App/Controls/RomListPanel.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Randomizer.App/Controls/RomListPanel.cs b/src/Randomizer.App/Controls/RomListPanel.cs index d632dff67..674ac3a87 100644 --- a/src/Randomizer.App/Controls/RomListPanel.cs +++ b/src/Randomizer.App/Controls/RomListPanel.cs @@ -197,7 +197,15 @@ public void CopyTextToClipboard(string text) } catch (System.Runtime.InteropServices.COMException) { - Clipboard.SetDataObject(text); + try + { + Clipboard.Clear(); + Clipboard.SetDataObject(text); + } + catch (Exception e) + { + // Ignored + } } } From e8ed6b1237a26049a6349cd4e45b749e7076a332 Mon Sep 17 00:00:00 2001 From: MattEqualsCoder Date: Wed, 25 Oct 2023 10:35:26 -0400 Subject: [PATCH 2/2] Add exception logging --- src/Randomizer.App/Controls/RomListPanel.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Randomizer.App/Controls/RomListPanel.cs b/src/Randomizer.App/Controls/RomListPanel.cs index 674ac3a87..ba2008e04 100644 --- a/src/Randomizer.App/Controls/RomListPanel.cs +++ b/src/Randomizer.App/Controls/RomListPanel.cs @@ -22,7 +22,6 @@ public abstract class RomListPanel : UserControl private TrackerWindow? _trackerWindow; private RomLauncherService _romLauncherService; - public RomListPanel(IServiceProvider serviceProvider, OptionsFactory optionsFactory, ILogger logger, @@ -204,7 +203,7 @@ public void CopyTextToClipboard(string text) } catch (Exception e) { - // Ignored + Logger.LogError(e, "Unable to copy to clipboard"); } } }