summary refs log tree commit diff
diff options
context:
space:
mode:
authorNepNep21 <nepnep91@protonmail.com>2024-04-09 12:47:02 -0300
committerNepNep21 <nepnep91@protonmail.com>2024-04-09 12:47:02 -0300
commit3f05df19a1e3d772bdcc5faf1587af61b03377f1 (patch)
tree9252e92989057506fb9bd474c61c68cd9515035d
parentWorkaround re2 cmake issue on AS runner (diff)
downloadnheko-3f05df19a1e3d772bdcc5faf1587af61b03377f1.tar.xz
Fix image copying on windows
-rw-r--r--src/timeline/TimelineModel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index b41d1e0c..8e8f72ce 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -2034,7 +2034,10 @@ TimelineModel::copyMedia(const QString &eventId) const
                   clipContents->setImageData(img);
               }
 
-              QGuiApplication::clipboard()->setMimeData(clipContents);
+              // Qt uses COM for clipboard management on windows and our HTTP threads do not initialize it, so run in the event loop
+              QTimer::singleShot(0, ChatPage::instance(), [clipContents] {
+                  QGuiApplication::clipboard()->setMimeData(clipContents);
+              });
 
               return;
           } catch (const std::exception &e) {