summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-08-19 14:49:27 +0300
committerTimo Turunen <timo.p.turunen@nokia.com>2011-08-30 10:02:18 +0300
commita8eaaf4dec21e7c671805db2ae8f6e3b6b18f80e (patch)
tree164450aa87f868a61f98b0dcf9159f9951d9f739 /src/gui/inputmethod
parentd88772c75302f607c8b7ca8540bef7be2d46a16b (diff)
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 (cherry picked from commit b186288cbf796be662f86ae4d5c70e39ba6afb67) Reapplied after bad v4.7.4 merge
Diffstat (limited to 'src/gui/inputmethod')
-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 98570153b1..8c30838071 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 8bdaa229ae..9cf4212fec 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