diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-09-09 12:23:25 +0200 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2014-09-10 20:35:59 +0200 |
commit | 395d865b8047f5ac20a082e846e37ceeb1c7afbd (patch) | |
tree | c2fa0c20eb2a501ed3c656c4fd0706a2fd3d191f /src/plugins/platforms/android/qandroidinputcontext.h | |
parent | b678cc29899b387b632596b7c0f85abf2fc8ea81 (diff) |
Android: fix inputmethod race conditions
focusObjectInputMethodQuery() and sendInputMethodEvent() were not
thread safe. Remove them, and replace with thread safe versions
based on the same principle as queryFocusObjectThreadSafe().
Task-number: QTBUG-40995
Change-Id: Idb6f0c6d3963b7e8e73e029e83d0367088146ca8
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/plugins/platforms/android/qandroidinputcontext.h')
-rw-r--r-- | src/plugins/platforms/android/qandroidinputcontext.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.h b/src/plugins/platforms/android/qandroidinputcontext.h index a467e4849e..ffadacaad4 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.h +++ b/src/plugins/platforms/android/qandroidinputcontext.h @@ -121,16 +121,15 @@ public slots: void updateCursorPosition(); private: - QSharedPointer<QInputMethodQueryEvent> focusObjectInputMethodQuery(Qt::InputMethodQueries queries = Qt::ImQueryAll); - void sendInputMethodEvent(QInputMethodEvent *event); + void sendInputMethodEventThreadSafe(QInputMethodEvent *event); + Q_INVOKABLE void sendInputMethodEventUnsafe(QInputMethodEvent *event); + + QSharedPointer<QInputMethodQueryEvent> focusObjectInputMethodQueryThreadSafe(Qt::InputMethodQueries queries = Qt::ImQueryAll); + Q_INVOKABLE QInputMethodQueryEvent *focusObjectInputMethodQueryUnsafe(Qt::InputMethodQueries queries); Q_INVOKABLE QVariant queryFocusObjectUnsafe(Qt::InputMethodQuery query, QVariant argument); QVariant queryFocusObjectThreadSafe(Qt::InputMethodQuery query, QVariant argument); -private slots: - virtual void sendEvent(QObject *receiver, QInputMethodEvent *event); - virtual void sendEvent(QObject *receiver, QInputMethodQueryEvent *event); - private: ExtractedText m_extractedText; QString m_composingText; |