diff --git a/src/Greenshot.Editor/Forms/ImageEditorForm.cs b/src/Greenshot.Editor/Forms/ImageEditorForm.cs index 5d21dc682..83c738f88 100644 --- a/src/Greenshot.Editor/Forms/ImageEditorForm.cs +++ b/src/Greenshot.Editor/Forms/ImageEditorForm.cs @@ -935,7 +935,8 @@ namespace Greenshot.Editor.Forms // Make sure the editor is visible WindowDetails.ToForeground(Handle); - bool saveToClipboard = _surface.CaptureDetails.CaptureMode == CaptureMode.Clipboard; + // If the user choose the clipboard as destination, just keep it also on close + bool saveToClipboard = _surface.CaptureDetails.CaptureDestinations.SingleOrDefault()?.Designation == nameof(WellKnownDestinations.Clipboard); MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel; // Dissallow "CANCEL" if the application needs to shutdown @@ -958,7 +959,6 @@ namespace Greenshot.Editor.Forms if (result.Equals(DialogResult.Yes)) { - // If the user choose the clipboard as destination, just keep it also on close if (saveToClipboard) { BtnClipboardClick(sender, e); diff --git a/src/Greenshot/Destinations/ClipboardDestination.cs b/src/Greenshot/Destinations/ClipboardDestination.cs index 41722b231..7c93a2f9a 100644 --- a/src/Greenshot/Destinations/ClipboardDestination.cs +++ b/src/Greenshot/Destinations/ClipboardDestination.cs @@ -20,6 +20,7 @@ */ using System; +using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using Greenshot.Base; @@ -82,11 +83,17 @@ namespace Greenshot.Destinations public override void OnExportedNotificationClick(SurfaceMessageEventArgs e) { Log.Info(Designation + " Notification Clicked!"); + + var captureDetails = new CaptureDetails + { + CaptureMode = CaptureMode.Clipboard, + CaptureDestinations = new List { DestinationHelper.GetDestination(Designation) } + }; - var surface = new Surface((Image)e.Image.Clone()) { CaptureDetails = new CaptureDetails { CaptureMode = CaptureMode.Clipboard } }; + var surface = new Surface((Image)e.Image.Clone()) { CaptureDetails = captureDetails }; DestinationHelper.GetDestination(EditorDestination.DESIGNATION) - .ExportCapture(true, surface, new CaptureDetails { CaptureMode = CaptureMode.Clipboard }); + .ExportCapture(true, surface, captureDetails); } } } \ No newline at end of file