From 85f8a8b35fc04fc550ca02578092b5580910aea5 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Sat, 26 Oct 2019 22:47:59 +0200 Subject: Clipboard: Fix pasting of image data on Windows Workaround for what is most likely a gtk bug. --- src/ui/clipboard.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui/clipboard.cpp') diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index c9910498e..5d6df02d7 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -1041,6 +1041,13 @@ bool ClipboardManagerImpl::_pasteImage(SPDocument *doc) // retrieve image data Glib::RefPtr img = _clipboard->wait_for_image(); +#ifdef _WIN32 + // For some reason the first call to wait_for_image() often fails, despite image data being available + // TODO: Figure out why that is and remove this hack. + if (!img) { + img = _clipboard->wait_for_image(); + } +#endif if (!img) { return false; } -- cgit v1.2.3