Fix 30s freeze after pasting

This commit is contained in:
Ilya Fedin 2021-07-07 16:32:39 +04:00 committed by John Preston
parent caddb44a2c
commit ee773a28bb
1 changed files with 14 additions and 3 deletions

View File

@ -499,15 +499,26 @@ QImage GtkIntegration::getImageFromClipboard() const {
try {
Glib::RefPtr<Gio::UnixFDList> outFdList;
auto reply = _private->dbusConnection->call_sync(
const auto loop = Glib::MainLoop::create();
Glib::VariantContainerBase reply;
_private->dbusConnection->call(
std::string(kObjectPath),
std::string(kInterface),
"GetImageFromClipboard",
{},
{},
outFdList,
[&](const Glib::RefPtr<Gio::AsyncResult> &result) {
try {
reply = _private->dbusConnection->call_finish(
result,
outFdList);
} catch (...) {
}
loop->quit();
},
ServiceName);
loop->run();
const auto streamSize = base::Platform::GlibVariantCast<int>(
reply.get_child(1));