From ff224584ec483ee4d1469a9ced15f8d4f6ffd814 Mon Sep 17 00:00:00 2001 From: Ben Olden-Cooligan Date: Sat, 7 Oct 2023 10:46:41 -0700 Subject: [PATCH] Gtk: Fix copy --- NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs b/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs index 215d4139a..7520154c7 100644 --- a/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs +++ b/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs @@ -44,6 +44,14 @@ public class GtkEtoPlatform : EtoPlatform return new Bitmap(new BitmapHandler(pixbuf)); } + public override void SetClipboardImage(Clipboard clipboard, Bitmap image) + { + // Without cloning the image, Gtk gives errors on paste. + // Presumably it assumes the application will keep the Pixbuf around + // (while on Windows/Mac we can just dispose right away). + base.SetClipboardImage(clipboard, image.Clone()); + } + public override IMemoryImage DrawHourglass(ImageContext imageContext, IMemoryImage image) { // TODO