mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 {
|
try {
|
||||||
Glib::RefPtr<Gio::UnixFDList> outFdList;
|
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(kObjectPath),
|
||||||
std::string(kInterface),
|
std::string(kInterface),
|
||||||
"GetImageFromClipboard",
|
"GetImageFromClipboard",
|
||||||
{},
|
{},
|
||||||
{},
|
[&](const Glib::RefPtr<Gio::AsyncResult> &result) {
|
||||||
outFdList,
|
try {
|
||||||
|
reply = _private->dbusConnection->call_finish(
|
||||||
|
result,
|
||||||
|
outFdList);
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
|
loop->quit();
|
||||||
|
},
|
||||||
ServiceName);
|
ServiceName);
|
||||||
|
|
||||||
|
loop->run();
|
||||||
|
|
||||||
const auto streamSize = base::Platform::GlibVariantCast<int>(
|
const auto streamSize = base::Platform::GlibVariantCast<int>(
|
||||||
reply.get_child(1));
|
reply.get_child(1));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue