Fix image copying on windows

This commit is contained in:
NepNep21 2024-04-09 12:47:02 -03:00
parent df88eccfb7
commit 3f05df19a1
No known key found for this signature in database
GPG key ID: 60372BB5B7534B09

View file

@ -2034,7 +2034,10 @@ TimelineModel::copyMedia(const QString &eventId) const
clipContents->setImageData(img); clipContents->setImageData(img);
} }
// 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); QGuiApplication::clipboard()->setMimeData(clipContents);
});
return; return;
} catch (const std::exception &e) { } catch (const std::exception &e) {