From 9f06d1f66bb428106bc82c8a273e58e7753335ff Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 3 Sep 2025 09:18:07 -0700 Subject: [PATCH] Fix image pasting for MacOS Apparently, GetImage() on MacOS does not always convert the image properly. So do a two-step here to get the Bitmap first, forcing the conversion and then going back to an image --- common/clipboard.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/clipboard.cpp b/common/clipboard.cpp index fe891e51e6..b66173b117 100644 --- a/common/clipboard.cpp +++ b/common/clipboard.cpp @@ -24,6 +24,7 @@ #include "clipboard.h" #include +#include #include #include #include @@ -90,10 +91,10 @@ std::unique_ptr GetImageFromClipboard() { if( wxTheClipboard->IsSupported( wxDF_BITMAP ) ) { - wxImageDataObject data; + wxBitmapDataObject data; if( wxTheClipboard->GetData( data ) ) { - image = std::make_unique( data.GetImage() ); + image = std::make_unique( data.GetBitmap().ConvertToImage() ); } } else if( wxTheClipboard->IsSupported( wxDF_FILENAME ) )