Skip to content

Commit f10a215

Browse files
committed
Fix sync issue in InputContext::preocessKeyEvent.
1 parent 4d72a9f commit f10a215

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/qibusinputcontext.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
#include <QCoreApplication>
12
#include "qibusinputcontext.h"
23
#include "qibusinputcontextproxy.h"
34

4-
55
namespace IBus {
66

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

150150
QDBusPendingReply<bool> reply = m_context->ProcessKeyEvent (keyval, keycode, state);
151-
reply.waitForFinished ();
151+
152+
do {
153+
QCoreApplication::processEvents (QEventLoop::WaitForMoreEvents);
154+
} while (QCoreApplication::hasPendingEvents () || !reply.isFinished ());
152155

153156
if (reply.isError ()) {
154157
qWarning () << "InputContext::processKeyEvent:" << reply.error ();

0 commit comments

Comments
 (0)