summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-08-19 11:49:27 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-08-19 11:49:27 (GMT)
commitb186288cbf796be662f86ae4d5c70e39ba6afb67 (patch)
treec7793c423a30b2b5628f73da48e9e365b8757ced
parent1679b2d71f4f573699aad20aebf4eacc7605fdc8 (diff)
downloadQt-b186288cbf796be662f86ae4d5c70e39ba6afb67.zip
Qt-b186288cbf796be662f86ae4d5c70e39ba6afb67.tar.gz
Qt-b186288cbf796be662f86ae4d5c70e39ba6afb67.tar.bz2
Exact word bubble doesn't disappear when screen is tapped (fix part 2)
Prevent syncing with native side, if input capability changes are pending. Native side seems to be rather touchy about extra events, and might crash if syncing is requested while handling a capability change is on-going. Additionally, only cancel the transaction once. Otherwise cancellation might lead into loop (since we sync the state with native side) that eventually causes the application to crash. Task-number: QTBUG-20919 Reviewed-by: Miikka Heikkinen
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h1
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp14
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 9857015..8c30838 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -154,6 +154,7 @@ private:
TUint m_textCapabilities;
bool m_inDestruction;
bool m_pendingInputCapabilitiesChanged;
+ bool m_pendingTransactionCancel;
int m_cursorVisibility;
int m_inlinePosition;
MFepInlineTextFormatRetriever *m_formatRetriever;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 8bdaa22..9cf4212 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -109,6 +109,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_textCapabilities(TCoeInputCapabilities::EAllText),
m_inDestruction(false),
m_pendingInputCapabilitiesChanged(false),
+ m_pendingTransactionCancel(false),
m_cursorVisibility(1),
m_inlinePosition(0),
m_formatRetriever(0),
@@ -1074,12 +1075,10 @@ void QCoeFepInputContext::CancelFepInlineEdit()
// We are not supposed to ever have a tempPreeditString and a real preedit string
// from S60 at the same time, so it should be safe to rely on this test to determine
// whether we should honor S60's request to clear the text or not.
- if (m_hasTempPreeditString)
+ if (m_hasTempPreeditString || m_pendingTransactionCancel)
return;
- // Sync with native side editor state. Native side can then do various operations
- // based on editor state, such as removing 'exact word bubble'.
- ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState);
+ m_pendingTransactionCancel = true;
QList<QInputMethodEvent::Attribute> attributes;
QInputMethodEvent event(QLatin1String(""), attributes);
@@ -1087,6 +1086,13 @@ void QCoeFepInputContext::CancelFepInlineEdit()
m_preeditString.clear();
m_inlinePosition = 0;
sendEvent(event);
+
+ // Sync with native side editor state. Native side can then do various operations
+ // based on editor state, such as removing 'exact word bubble'.
+ if (!m_pendingInputCapabilitiesChanged)
+ ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState);
+
+ m_pendingTransactionCancel = false;
}
TInt QCoeFepInputContext::DocumentLengthForFep() const