summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2024-04-24 22:58:52 +0000
committerGitHub <noreply@github.com>2024-04-24 22:58:52 +0000
commit9f2f1c62de9f6b369b9da8cc1f24ca30455e0681 (patch)
treed1baf8925702697afae6c41a5944e6189a4840b3
parentMerge pull request #1715 from br4yd/fix-settings-cutoff (diff)
parentLint (diff)
downloadnheko-9f2f1c62de9f6b369b9da8cc1f24ca30455e0681.tar.xz
Merge pull request #1708 from NepNep21/windows-image-copying
Fix image copying on windows
-rw-r--r--src/timeline/TimelineModel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index b41d1e0c..3e3434b4 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -2034,7 +2034,11 @@ 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) {