Skip to content

Commit

Permalink
Fix sync issue in InputContext::preocessKeyEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
phuang committed Dec 5, 2009
1 parent 4d72a9f commit f10a215
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/qibusinputcontext.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <QCoreApplication>
#include "qibusinputcontext.h"
#include "qibusinputcontextproxy.h"


namespace IBus {

InputContext::InputContext (const BusPointer &bus, const QString &path)
Expand Down Expand Up @@ -148,7 +148,10 @@ InputContext::processKeyEvent (uint keyval, uint keycode, uint state)
Q_ASSERT (m_context);

QDBusPendingReply<bool> 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 ();
Expand Down

0 comments on commit f10a215

Please sign in to comment.