Skip to content

Commit

Permalink
Fix Clipboard crashes with ExternalException (#23) by @r4dius
Browse files Browse the repository at this point in the history
Got ExternalException on clipboard copy once, can't reproduce but it seems setDataObject will help with 10 automatic retries spaced by 100ms
  • Loading branch information
r4dius authored and garoxas committed Nov 19, 2019
1 parent 15d6a5e commit a9b14fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Windows/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ private void copyToolStripMenuItem_Click(object sender, EventArgs e)

if (text.Any() && !text.All(x => String.IsNullOrEmpty(x)))
{
Clipboard.SetText(String.Join("\n", text));
Clipboard.SetDataObject(new DataObject(DataFormats.Text, String.Join("\n", text)));
}
else
{
Expand Down

0 comments on commit a9b14fb

Please sign in to comment.