mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Fix 30s freeze after pasting
This commit is contained in:
parent
caddb44a2c
commit
ee773a28bb
1 changed files with 14 additions and 3 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue