diff --git a/Greenshot/Destinations/ClipboardDestination.cs b/Greenshot/Destinations/ClipboardDestination.cs
index a1172ede4..6b10a483f 100644
--- a/Greenshot/Destinations/ClipboardDestination.cs
+++ b/Greenshot/Destinations/ClipboardDestination.cs
@@ -64,6 +64,8 @@ namespace Greenshot.Destinations {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description);
+ // close the form after copying the image to clipboard
+ exportInformation.CloseForm = true;
try {
ClipboardHelper.SetClipboardData(surface);
exportInformation.ExportMade = true;
diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs
index a9fe79239..fff9ae748 100644
--- a/Greenshot/Forms/ImageEditorForm.cs
+++ b/Greenshot/Forms/ImageEditorForm.cs
@@ -956,7 +956,11 @@ namespace Greenshot.Forms {
}
if (destination.EditorShortcutKeys == keys) {
- destination.ExportCapture(true, _surface, _surface.CaptureDetails);
+ ExportInformation exportInformation = destination.ExportCapture(true, _surface, _surface.CaptureDetails);
+ if (exportInformation != null && exportInformation.ExportMade) {
+ if (exportInformation.CloseForm)
+ this.Close();
+ }
return true;
}
}
@@ -1297,6 +1301,8 @@ namespace Greenshot.Forms {
ExportInformation exportInformation = clickedDestination?.ExportCapture(true, _surface, _surface.CaptureDetails);
if (exportInformation != null && exportInformation.ExportMade) {
_surface.Modified = false;
+ if (exportInformation.CloseForm)
+ this.Close();
}
}
diff --git a/GreenshotPlugin/Interfaces/IDestination.cs b/GreenshotPlugin/Interfaces/IDestination.cs
index 8bfb72ac3..6042e01ca 100644
--- a/GreenshotPlugin/Interfaces/IDestination.cs
+++ b/GreenshotPlugin/Interfaces/IDestination.cs
@@ -48,6 +48,11 @@ namespace GreenshotPlugin.Interfaces {
public string ErrorMessage { get; set; }
public string Filepath { get; set; }
+
+ ///
+ /// Set to true to close the invoking form.
+ ///
+ public bool CloseForm { get; set; }
}
///