From f10a2153b604ba66653fe526596aae66583133c0 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Sat, 5 Dec 2009 22:37:35 +0800 Subject: [PATCH] Fix sync issue in InputContext::preocessKeyEvent. --- src/qibusinputcontext.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qibusinputcontext.cpp b/src/qibusinputcontext.cpp index 27c146b..046a335 100644 --- a/src/qibusinputcontext.cpp +++ b/src/qibusinputcontext.cpp @@ -1,7 +1,7 @@ +#include #include "qibusinputcontext.h" #include "qibusinputcontextproxy.h" - namespace IBus { InputContext::InputContext (const BusPointer &bus, const QString &path) @@ -148,7 +148,10 @@ InputContext::processKeyEvent (uint keyval, uint keycode, uint state) Q_ASSERT (m_context); QDBusPendingReply reply = m_context->ProcessKeyEvent (keyval, keycode, state); - reply.waitForFinished (); + + do { + QCoreApplication::processEvents (QEventLoop::WaitForMoreEvents); + } while (QCoreApplication::hasPendingEvents () || !reply.isFinished ()); if (reply.isError ()) { qWarning () << "InputContext::processKeyEvent:" << reply.error ();