summaryrefslogtreecommitdiffstats
path: root/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
diff options
context:
space:
mode:
authorIlya Fedin <fedin-ilja2010@ya.ru>2021-07-07 16:32:39 +0400
committerJohn Preston <johnprestonmail@gmail.com>2021-07-07 16:40:09 +0300
commitee773a28bb62b93fcf56763a366f689977087a0c (patch)
treed9173f3d68b6d3c9b0b4272f8cd367668f5bbe77 /Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
parentcaddb44a2c3e21044d09375913dde0b8731de22b (diff)
Fix 30s freeze after pasting
Diffstat (limited to 'Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp')
-rw-r--r--Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
index 3faec92486..451408c397 100644
--- a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
+++ b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
@@ -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));